YOLO-BFRV: An Efficient Model for Detecting Printed Circuit Board Defects
Abstract
:1. Introduction
- (1)
- The introduction of a BIFPN in the Neck addresses the problems of PANet in the original model regarding the fusion of diverse layer features. This enhancement significantly improves the model’s capacity to capture small target feature information, thereby enabling more efficient extraction of various defect features.
- (2)
- The FasterNet lightweight network is integrated into the Backbone, effectively utilizing the channel information across various PCB defect types. This integration preserves the diversity of defect features and enhances the computational efficiency all while improving detection accuracy.
- (3)
- The detection head has been reconstructed, incorporating a re-parameterized design that reduces the number of parameters while enhancing the detection capabilities for small target defects.
- (4)
- To address the challenge of detecting PCB defects in dense distributions, this paper employs VarifocalLoss as the loss function. This approach mitigates the difficulties associated with defect detection in such contexts and significantly enhances the model’s detection accuracy.
2. Materials and Methods
2.1. Dataset
2.1.1. Dataset Collection
2.1.2. Dataset Augmentation
2.2. Methods
2.2.1. Bidirectional Feature Pyramid Network (BIFPN)
2.2.2. FasterNet
2.2.3. RepHead Based on Structural Re-Parameterization Construction
2.2.4. Varifocal Loss
2.2.5. YOLO-BRFV Model
2.3. Experimental Parameters and Environment
2.4. Model Evaluation Metrics
3. Results
3.1. Comparison of Different Benchmark Models
3.1.1. Experimental Results of HIRIPCB
3.1.2. Experimental Results of DeepPCB
3.2. Results of Ablation Experiments
- (1)
- The benchmark model exhibits the lowest detection accuracy due to the presence of spurs, spurious_copper, and other small target defects within the dataset, which are challenging to identify, leading to a lower overall detection accuracy.
- (2)
- Model C achieves a significant boost in detection speed after upgrading the backbone to FasterNet. However, the computational load is slightly increased due to the inclusion of PConv in its architecture. Models B, D, and E show varying degrees of improvement in detection accuracy and speed after the integration of sub-modules.
- (3)
- Models F, G, and H, which incorporate BIFPN into the original architecture, demonstrate higher accuracy and a slight increase in detection speed compared to the traditional PANet structure in the original Neck component.
- (4)
- After integrating all of the improved modules, Model I shows enhanced feature extraction and fusion capabilities by effectively suppressing irrelevant information. Consequently, the overall performance of the model surpasses that of the baseline, particularly in detecting smaller targets.
3.3. Loss Function Comparison Experiments
- (1)
- As illustrated in the figure, the loss function proposed in this paper demonstrates robustness in detecting various types of small PCB defects and exhibits terrific generalization capability.
- (2)
- As shown in Table 4, the mAP values of Varifocal Loss are 5.4%, 4%, and 3.1% higher than those of Focal Loss, Quality Focal Loss, and Slide Loss, respectively.
4. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Tan, Q.; Liu, L.; Yu, M.; Li, J. An innovative method of recycling metals in printed circuit board (PCB) using solutions from PCB production. J. Hazard. Mater. 2020, 390, 121892. [Google Scholar] [CrossRef] [PubMed]
- Chaudhary, V.; Dave, I.R.; Upla, K.P. Automatic visual inspection of printed circuit board for defect detection and classification. In Proceedings of the 2017 International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), Chennai, India, 22–24 March 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 732–737. [Google Scholar]
- Li, Y.; Li, S. 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]
- Abd Al Rahman, M.; Mousavi, A. A review and analysis of automatic optical inspection and quality monitoring methods in electronics industry. IEEE Access 2020, 8, 183192–183271. [Google Scholar]
- Cao, G.; Ruan, S.; Peng, Y.; Huang, S.; Kwok, N. Large-complex-surface defect detection by hybrid gradient threshold segmentation and image registration. IEEE Access 2018, 6, 36235–36246. [Google Scholar] [CrossRef]
- Li, R.; Tian, F.; Chen, S. Research on double edge detection method of midsole based on improved Otsu method. IEEE Access 2020, 8, 221539–221552. [Google Scholar] [CrossRef]
- Lyu, R.; Lu, J.; Zhao, Z.; Zhang, Y.; Han, J.; Bai, L. Welding defects on new energy batteries based on 2D pre-processing and improved-region-growth method in the small field of view. Meas. Sci. Technol. 2023, 35, 015409. [Google Scholar] [CrossRef]
- Xia, B.; Cao, J.; Wang, C. SSIM-NET: Real-time PCB defect detection based on SSIM and MobileNet-V3. In Proceedings of the 2019 2nd World Conference on Mechanical Engineering and Intelligent Manufacturing (WCMEIM), Shanghai, China, 22–24 November 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 756–759. [Google Scholar]
- Liu, G.; Wen, H. Printed circuit board defect detection based on MobileNet-Yolo-Fast. J. Electron. Imaging 2021, 30, 043004. [Google Scholar] [CrossRef]
- Ding, R.; Dai, L.; Li, G.; Liu, H. TDD-net: A tiny defect detection network for printed circuit boards. CAAI Trans. Intell. Technol. 2019, 4, 110–116. [Google Scholar] [CrossRef]
- Lim, J.; Lim, J.; Baskaran, V.M.; Wang, X. A deep context learning based PCB defect detection model with anomalous trend alarming system. Results Eng. 2023, 17, 100968. [Google Scholar] [CrossRef]
- Hua, C.; Zou, X.; Ling, Y.; Chen, Y. Visual saliency detection via a recurrent residual convolutional neural network based on densely aggregated features. Comput. Graph. 2022, 104, 72–85. [Google Scholar] [CrossRef]
- Park, J.-Y.; Hwang, Y.; Lee, D.; Kim, J.-H. MarsNet: Multi-label classification network for images of various sizes. IEEE Access 2020, 8, 21832–21846. [Google Scholar] [CrossRef]
- 2019-01-1253; Securing Printed Board Performance and Assembly Reliability in Automotive Applications through IPC Standards. SAE: Warrendale, PA, USA, 2019.
- Huang, W.; Wei, P.; Zhang, M.; Liu, H. HRIPCB: A challenging dataset for PCB defects detection and classification. J. Eng. 2020, 2020, 303–309. [Google Scholar] [CrossRef]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar]
- Lyu, H.; Qiu, F.; An, L.; Stow, D.; Lewison, R.; Bohnett, E. Deer survey from drone thermal imagery using enhanced faster R-CNN based on ResNets and FPN. Ecol. Inform. 2024, 79, 102383. [Google Scholar] [CrossRef]
- He, Z.; Gong, P.; Ye, H.; Gan, Z. Lane Attribute Classification Based on Fine-Grained Description. Sensors 2024, 24, 4800. [Google Scholar] [CrossRef] [PubMed]
- Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 10781–10790. [Google Scholar]
- Yin, L.; Zainudin, M.; Saad, W.; Sulaiman, N.; Idris, M.; Kamarudin, M.; Mohamed, R.; Razak, M. Analysis Recognition of Ghost Pepper and Cili-Padi using Mask-RCNN and YOLO. Prz. Elektrotechniczny 2023, 2023, 92. [Google Scholar] [CrossRef]
- Chen, J.; Kao, S.-H.; He, H.; Zhuo, W.; Wen, S.; Lee, C.-H.; Chan, S.-H.G. Run, don’t walk: Chasing higher FLOPS for faster neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 12021–12031. [Google Scholar]
- Ding, X.; Zhang, X.; Ma, N.; Han, J.; Ding, G.; Sun, J. Repvgg: Making vgg-style convnets great again. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13733–13742. [Google Scholar]
- Hu, X.; Kong, D.; Liu, X.; Zhang, J.; Zhang, D. FM-STDNet: High-speed detector for fast-moving small targets based on deep first-order network architecture. Electronics 2023, 12, 1829. [Google Scholar] [CrossRef]
- Wu, T.; Gao, G.; Huang, J.; Wei, X.; Wei, X.; Liu, C.H. Adaptive spatial-bce loss for weakly supervised semantic segmentation. In Proceedings of the European Conference on Computer Vision, Tel Aviv, Israel, 23–27 October 2022; Springer: Berlin/Heidelberg, Germany, 2022; pp. 199–216. [Google Scholar]
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
- Zhang, H.; Wang, Y.; Dayoub, F.; Sunderhauf, N. Varifocalnet: An iou-aware dense object detector. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 8514–8523. [Google Scholar]
- Wu, S.; Li, X.; Wang, X. IoU-aware single-stage object detector for accurate localization. Image Vis. Comput. 2020, 97, 103911. [Google Scholar] [CrossRef]
- Agrawal, P.; Girshick, R.; Malik, J. Analyzing the performance of multilayer neural networks for object recognition. In Proceedings of the Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, 6–12 September 2014; Proceedings, Part VII 13, 2014. Springer: Berlin/Heidelberg, Germany, 2014; pp. 329–344. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [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]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. IEEE Trans. Pattern Anal. Mach. Intell. 2016, 39, 1137–1149. [Google Scholar] [CrossRef]
- Plastiras, G.; Kyrkou, C.; Theocharides, T. You only look once: Unified, real-time object detection. In Proceedings of the ACM International Conference on Interactive Surfaces and Spaces, New York, NY, USA, 25–28 November 2018. [Google Scholar]
- 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 Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part I 14, 2016. Springer: Berlin/Heidelberg, Germany, 2016; pp. 21–37. [Google Scholar]
- Wang, C.-Y.; Bochkovskiy, A.; Liao, H.-Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
- Zhao, Y.; Lv, W.; Xu, S.; Wei, J.; Wang, G.; Dang, Q.; Liu, Y.; Chen, J. Detrs beat yolos on real-time object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, DC, USA, 17–21 June 2024; pp. 16965–16974. [Google Scholar]
- Tang, S.; He, F.; Huang, X.; Yang, J. Online PCB defect detector on a new PCB defect dataset. arXiv 2019, arXiv:1902.06197. [Google Scholar]
- Yu, Z.; Huang, H.; Chen, W.; Su, Y.; Liu, Y.; Wang, X. YOLO-FaceV2: A Scale and Occlusion Aware Face Detector. arXiv 2022, arXiv:2208.02019. [Google Scholar] [CrossRef]
- Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. Adv. Neural Inf. Process. Syst. 2020, 33, 21002–21012. [Google Scholar]
Programs | Settings |
---|---|
Operating system | Ubuntu |
CPU | Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz (Intel, Santa Clara, CA, USA) |
GPU | NVIDIA A100 100GB PCIe (Nvidia, Santa Clara, CA, USA) |
RAM | 100 GB |
Python version | 3.7 |
Model | mAP@50/% | P/% | R/% | Parameter Size |
---|---|---|---|---|
FasterR-CNN | 84.5 | 87.3 | 92.7 | 24.59 M |
YOLOv5 | 92.5 | 88.1 | 93.6 | 7.1 M |
YOLOv7 | 94.7 | 89.3 | 94.3 | 37.1 M |
YOLOv8s | 94.5 | 92.6 | 95.1 | 30.2 M |
RT-DETR | 95.6 | 93.5 | 95.9 | 38.5 M |
OURS | 98.4 | 96.9 | 98.2 | 6.7 M |
Model | BIFPN | FasterNet | RepHead | VarifocalLoss | mAP@50/% | P/% | R/% | fps/s | GFLOPS |
---|---|---|---|---|---|---|---|---|---|
A | 94.5 | 92.6 | 95.1 | 97.4 | 6.3 | ||||
B | ✓ | 96.3 | 94 | 96.2 | 102.1 | 6.6 | |||
C | ✓ | 97.4 | 96 | 95.6 | 134.2 | 10.7 | |||
D | ✓ | 97.7 | 96.5 | 96.1 | 107.2 | 6.9 | |||
E | ✓ | 95.6 | 94.6 | 93.8 | 98.6 | 6.3 | |||
F | ✓ | ✓ | 97.4 | 95.9 | 96.6 | 138.5 | 8.2 | ||
G | ✓ | ✓ | 96.5 | 94.6 | 97.2 | 118.2 | 8.6 | ||
H | ✓ | ✓ | 96.9 | 96.4 | 95.2 | 109.2 | 7.1 | ||
I | ✓ | ✓ | ✓ | ✓ | 98.4 | 96.9 | 98.2 | 142.1 | 11.5 |
Loss Function | mAP50/% | P/% | R/% |
---|---|---|---|
Focal Loss | 90.2 | 91.4 | 88.5 |
Quality Focal Loss | 91.6 | 88.9 | 89.7 |
Slide Loss | 92.5 | 90.6 | 90.5 |
Varifocal Loss | 95.6 | 94.6 | 93.8 |
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
Liu, J.; Kang, B.; Liu, C.; Peng, X.; Bai, Y. YOLO-BFRV: An Efficient Model for Detecting Printed Circuit Board Defects. Sensors 2024, 24, 6055. https://doi.org/10.3390/s24186055
Liu J, Kang B, Liu C, Peng X, Bai Y. YOLO-BFRV: An Efficient Model for Detecting Printed Circuit Board Defects. Sensors. 2024; 24(18):6055. https://doi.org/10.3390/s24186055
Chicago/Turabian StyleLiu, Jiaxin, Bingyu Kang, Chao Liu, Xunhui Peng, and Yan Bai. 2024. "YOLO-BFRV: An Efficient Model for Detecting Printed Circuit Board Defects" Sensors 24, no. 18: 6055. https://doi.org/10.3390/s24186055
APA StyleLiu, J., Kang, B., Liu, C., Peng, X., & Bai, Y. (2024). YOLO-BFRV: An Efficient Model for Detecting Printed Circuit Board Defects. Sensors, 24(18), 6055. https://doi.org/10.3390/s24186055