EC-YOLO: Improved YOLOv7 Model for PCB Electronic Component Detection

Shiyi Luo, Fang Wan, Guangbo Lei, Li Xu, Zhiwei Ye, Liu We, Wen Zhou, Chengzhi XuSensors 2024 · DOI

TL;DR

This paper introduces EC-YOLOv7, an enhanced YOLOv7 model designed for accurate and efficient detection of electronic components (ECs) on Printed Circuit Boards (PCBs). By integrating novel modules like ACmix, DyHead, and WIoU-Soft-NMS, the model significantly improves detection accuracy and speed, addressing key challenges in PCB recycling and intelligent manufacturing.

What Problem Does This Paper Address?

The increasing volume of electronic waste, particularly from Printed Circuit Boards (PCBs), presents a significant recycling challenge. Electronic Components (ECs) are the core of PCBs, and their efficient detection and classification are crucial for effective reuse and material recovery. However, traditional object detection methods struggle with the high density, diverse shapes, and varying sizes of ECs found on PCBs, leading to slow detection speeds and low accuracy. This hinders automated recycling processes and the development of intelligent manufacturing systems that rely on precise component recognition.

Methods

The EC-YOLOv7 model builds upon the YOLOv7 architecture, introducing several key enhancements:

  • ACmix Module: This module replaces standard 3x3 convolutional layers within the E-ELAN architecture. ACmix is a novel fusion of self-attention and convolution, aiming to improve feature extraction and network inference speed.
  • ResNet-ACmix Module: Integrated into the backbone, this module leverages the ACmix concept within a ResNet-like structure to prevent data leakage and reduce computation time, while enhancing feature retention.
  • AC-E-ELAN Module: This refined version of the E-ELAN block incorporates ACmix modules and branching connections to improve the network's ability to capture rich multimodal learning and feature representations, balancing computational efficiency with performance.
  • SPPFCSPC Module: The Spatial Pyramid Pooling (SPP) and Convolutional Spatial Pyramid Pooling (CSP) components in the neck are optimized by replacing serial channels with concurrent channels to speed up feature fusion.
  • DyHead (Dynamic Head): This attention-based detection head is integrated to enhance the model's ability to perceive ECs at different scales and in complex scenes, improving detection accuracy and spatial information capture.
  • WIoU-Soft-NMS: A novel bounding box loss regression method that combines the WIoU loss function with Soft-NMS. This aims to improve prediction regression, enhance localization accuracy, and effectively handle overlapping objects, reducing false positives and missed detections.

Datasets

The study utilizes the publicly available "FICS-PCB" dataset. This dataset contains 9912 images of PCBs with diverse component types and viewing conditions, annotated with detailed labeling information. For their experiments, the authors preprocessed the dataset by performing random cropping to obtain 640x640 pixel sub-images and applied data augmentation techniques (rotation, flipping, noise addition, chromatic transformations) to generate a richer dataset. The final processed dataset consisted of 1563 images, split into training, validation, and test sets in an 8:1:1 ratio.

Key Insights and Ideas

  • Synergy of Attention and Convolution: The ACmix module demonstrates that combining self-attention and convolution can lead to more efficient and effective feature extraction compared to using either alone.
  • Dynamic Attention for Scale and Task Awareness: The DyHead module highlights the power of dynamic attention mechanisms in adapting to varying object scales and complex scene layouts, crucial for dense EC detection.
  • Addressing Overlapping Objects is Critical: The WIoU-Soft-NMS approach underscores the persistent challenge of object overlap in dense scenes and shows that specialized loss functions and Non-Maximum Suppression (NMS) techniques are vital for robust detection.
  • Modular Improvements Compound: The ablation studies clearly show that each proposed module contributes positively to the overall performance, and their combined effect is significantly greater than the sum of individual improvements.

Key Results

The EC-YOLOv7 model achieved state-of-the-art performance on the FICS-PCB dataset:

  • Mean Average Precision ([email protected]): Achieved an impressive 94.4%, a significant improvement over the original YOLOv7 (89.5%) and other popular detection models like Faster-RCNN, SSD, RetinaNet, and YOLOv5.
  • Frames Per Second (FPS): The model achieved 82.5 FPS, demonstrating a substantial speedup compared to the original YOLOv7 (58.1 FPS) and other methods, making it suitable for real-time applications.
  • Ablation Study: The integration of all proposed modules (ResNet-ACmix, AC-E-ELAN, SPPFCSPC, DyHead, WIoU-Soft-NMS) led to a cumulative increase in [email protected] from 89.5% to 94.4%.
  • Visual Comparison: Qualitative results showed EC-YOLOv7's superior ability to detect densely packed and overlapping ECs with fewer false positives and missed detections compared to baseline models.

Limitations and Future Work

  • Dataset Specificity: While the FICS-PCB dataset is comprehensive, the model's performance might vary on datasets with different types or densities of ECs.
  • Computational Cost of Attention: Although ACmix and DyHead aim for efficiency, attention mechanisms can still be computationally intensive, especially in very large models or resource-constrained environments.
  • Future Work: The authors suggest that further research could explore more advanced attention mechanisms, investigate different network architectures, and potentially adapt the model for other object detection tasks beyond ECs on PCBs. The paper also implies that continued optimization for even faster inference speeds while maintaining high accuracy would be beneficial.

Summary updated

Abstract

Electronic components are the main components of PCBs (printed circuit boards), so the detection and classification of ECs (electronic components) is an important aspect of recycling used PCBs. However, due to the variety and quantity of ECs, traditional target detection methods for EC classification still have problems such as slow detection speed and low performance, and the accuracy of the detection needs to be improved. To overcome these limitations, this study proposes an enhanced YOLO (you only look once) network (EC-YOLOv7) for detecting EC targets. The network uses ACmix (a mixed model that enjoys the benefits of both self-attention and convolution) as a substitute for the 3 × 3 convolutional modules in the E-ELAN (Extended ELAN) architecture and implements branch links and 1 × 1 convolutional arrays between the ACmix modules to improve the speed of feature retrieval and network inference. Furthermore, the ResNet-ACmix module is engineered to prevent the leakage of function data and to minimise calculation time. Subsequently, the SPPCSPS (spatial pyramid pooling connected spatial pyramid convolution) block has been improved by replacing the serial channels with concurrent channels, which improves the fusion speed of the image features. To effectively capture spatial information and improve detection accuracy, the DyHead (the dynamic head) is utilised to enhance the model's size, mission, and sense of space, which effectively captures spatial information and improves the detection accuracy. A new bounding-box loss regression method, the WIoU-Soft-NMS method, is finally suggested to facilitate prediction regression and improve the localisation accuracy. The experimental results demonstrate that the enhanced YOLOv7 net surpasses the initial YOLOv7 model and other common EC detection methods. The proposed EC-YOLOv7 network reaches a mean accuracy ([email protected]) of 94.4% on the PCB dataset and exhibits higher FPS compared to the original YOLOv7 model. In conclusion, it can significantly enhance high-density EC target recognition.
BibTeX
@inproceedings{luo2024ec,
  author = {Shiyi Luo and Fang Wan and Guangbo Lei and Li Xu and Zhiwei Ye and Liu We and Wen Zhou and Chengzhi Xu},
  title = {{EC-YOLO: Improved YOLOv7 Model for PCB Electronic Component Detection}},
  booktitle = {Sensors},
  year = {2024},
  doi = {10.3390/s24134363},
}
Figure