1. Introduction
Quality and safety have always been the most critical requirements in automotive design, as they are directly linked to the safety of drivers and passengers. In recent years, the rapid development of new energy vehicles, exemplified by electric vehicles, has led to the widespread use of PCBs [
1]. As illustrated in
Figure 1, PCBs are abundantly present in EVs, serving as the medium for communication and electric power transmission. Core components of electric vehicles, such as batteries, electric drives, and electronic controls, heavily rely on PCBs. If the PCBs used in vehicles are flawed, the consequences can range from the accelerated deterioration of components to the failure of key functions, posing a threat to driving safety. It can be said that PCBs are not only the foundation of modern EV electronic systems but also directly influence the performance and safety of the vehicles. Therefore, conducting defect detection on PCBs used in vehicles is essential to reduce the risk of vehicle failure [
2].
Firstly, as PCBs are the core components of numerous electronic systems in electric vehicles, any defects in them can directly affect the performance and reliability of these systems [
3]. For example, critical components such as the battery management system, motor control unit, charging system, and onboard infotainment systems all rely on the proper functioning of PCBs. Defects in PCBs might lead to interruptions or errors in electronic signal transmission, potentially causing a decline in system performance. This could manifest in various ways, including reduced battery charging efficiency, sluggish response of the electric motor, or the failure of navigation and entertainment systems. In the worst-case scenario, these defects might lead to failures in safety systems, such as brake assist or emergency braking systems, which in extreme cases could result in accidents. Moreover, surface defects on PCBs could lead to electrical short circuits, causing the battery to overheat, potentially leading to fires or explosions [
4,
5]. Such faults pose not only a risk to passenger safety but can also cause significant property damage. Due to the dependence of electric vehicles on complex electronic systems, the reliability of PCBs becomes a crucial factor in ensuring overall vehicle performance and passenger safety. The presence of defects could necessitate frequent vehicle maintenance, increasing maintenance costs, and also affecting consumer trust and satisfaction with the brand [
6].
In summary, defects on the surface of PCBs can have a widespread negative impact on the performance, safety, reliability, and overall consumer experience of electric vehicles. Thus, conducting efficient and precise PCB defect detection becomes especially critical during the manufacturing process of electric vehicles [
7,
8]. Traditional methods of detection, such as manual inspection or simple image processing techniques, face challenges when dealing with complex, minute, or irregular defects and struggle to meet the strict standards for detection speed and accuracy required in the EV industry. Therefore, developing new detection technologies to enhance the reliability of electronic systems in electric vehicles is an important task in the current landscape.
In recent years, deep learning and convolutional neural networks (CNNs) have made remarkable progress in the field of image processing and recognition. Particularly, real-time object detection algorithms, such as the YOLO (You Only Look Once) series, have provided powerful tools for real-time image detection [
9]. YOLOv5, known for its efficient detection speed and high accuracy, has garnered widespread attention. However, directly applying the original YOLOv5 model may not fully meet the specific requirements of PCB defect detection, such as issues with class imbalance, multi-scale defects, and complex backgrounds [
10].
To address the aforementioned challenges, Ali Sezer and Aytaeli Altan proposed an optimized deep learning model for detecting post-soldering defects in PCBs, utilizing 2D signal processing methods [
11]. Despite the availability of advanced sensing technologies, setting pass/fail criteria based on a limited number of failure samples has always been a challenge. To overcome these issues, Jungsuk Kim and colleagues introduced an advanced PCB inspection system based on a convolutional autoencoder with skip connections [
12]. For comprehensive automation of the detection process, Yehonatan Fridman and others proposed an automated, integrated change detection system named ChangeChip. This system, based on computer vision and unsupervised learning, can detect a range of issues, from soldering defects to missing or misplaced electronic components [
13]. Bing Hu developed a new network based on Faster R-CNN, utilizing ResNet50 with a feature pyramid network as the backbone for feature extraction, enhancing the detection of small defects on PCBs. Additionally, GARPN was used for more accurate anchor prediction, and residual units from ShuffleNetV2 were integrated [
14]. To address the challenge of achieving high detection accuracy, fast detection speed, and low memory consumption simultaneously, Xinting Liao and colleagues improved the activation functions in the backbone and neck prediction networks of YOLOv4, yielding results superior to other state-of-the-art detectors compared [
15]. To enhance sensitivity to small defects, Wang Xuan and team proposed a new lightweight deep learning-based defect detection network named YOLOX-MC-CA. This network, developed on the basis of YOLOX, adopted a coordinate attention mechanism to improve the recognition of small PCB surface defects and modified the backbone network of YOLOX to a new CSPDarknet structure with some inverted residual blocks [
16].
This study proposes a customized network structure based on YOLOv5, incorporating the NWD loss in its loss function to enhance the accuracy and robustness of the model in detecting PCB surface defects. The YOLOv5 model has been appropriately adjusted in terms of parameters and optimized in its network structure to meet the specific demands of PCB defect detection. Particularly, this is achieved by introducing the CBAM along with additional connections and convolution layers, facilitating multi-scale feature fusion and enhancing the model’s attention mechanism. Furthermore, custom anchor sizes have been defined to accommodate defects of varying sizes and shapes.
This research aims to provide an effective technological approach in the electric vehicle industry for enhancing the quality of electronic components, thereby improving overall vehicle performance and safety. It is dedicated to exploring the application of deep learning technology in PCB defect detection and how the optimization of network structure and design of loss functions can improve the model’s detection performance. The model was trained and validated on a public PCB image dataset. Preliminary results show that compared to the YOLOv5 model based on traditional loss functions, the model proposed in this study demonstrates a significant advantage in detection accuracy and false detection rate, particularly in detecting complex and minute defects. These technological advancements are expected to contribute to significant improvements in production efficiency and product reliability in the electric vehicle industry.
The contribution of this study lies in the innovative enhancement of the YOLOv5 framework, integrating multi-scale CBAM, partial convolution, and NWD loss to enhance the accuracy of defect detection in electric vehicle PCBs. Experiments on a public PCB dataset demonstrate significant advantages in detection precision and reduced false positive rates, compared to existing technologies. These advancements offer new perspectives in intelligent manufacturing and automated inspection.
4. Summary and Outlook
In this research, the proposed enhancements of the YOLOv5 model significantly improve the efficiency and accuracy of PCB surface defect detection, which is of great importance to the electric vehicle industry. By integrating a multi-scale attention mechanism, applying PConv lightweight convolution, and optimizing the loss function, the model achieves an ideal balance between size, speed, and accuracy. These improvements not only enhance the accuracy of defect detection but also contribute to the reliability and safety of the electronic systems in electric vehicles, thereby directly impacting the overall performance of the vehicles. Although the model outperforms traditional methods in several respects, there is still room for improvement in terms of robustness under extreme lighting conditions, and generalization for other datasets. Future research will focus on these challenges, aiming to further enhance the model’s generalization ability and adaptability through in-depth network optimization and algorithmic innovations. Additionally, when deploying such models to actual electric vehicle production lines, integration with existing systems, and challenges like data biases and model overfitting encountered in practical operations, must be considered. Through continuous research and collaboration with the industry, it is expected that these theoretical improvements will be translated into reliable solutions in practical applications, bringing higher production efficiency and stronger system reliability to the electric vehicle sector, thereby advancing the industry’s technological progress and competitive edge.