As the cornerstone of contemporary electronics, the quality of electronic substrates—including Printed Circuit Boards (PCBs) and Ceramic Package Substrates (CPSs)—is intrinsic to product reliability. However, automated inspection is currently impeded by two persistent obstacles: the drastic multi-scale variation in defects and the acute class imbalance within defect datasets. Conventional deep learning approaches often fail to reconcile these challenges simultaneously, leading to suboptimal recognition of rare defect categories. To bridge this gap, we propose Multi-scale Partial Vision Transformer—Simple, Parameter-free Attention Module (MulPViT-SimAM), a robust framework designed for class-imbalanced electronic substrate defect detection. Our method features a novel multi-scale backbone (MulPViT) that synergizes partial convolutions with hierarchical attention mechanisms, facilitating the efficient extraction of both fine-grained local textures and global contextual dependencies. Additionally, we embed the Simple, Parameter-free Attention Module (SimAM) into the feature fusion stage to adaptively highlight defect-specific features while dampening background noise. To further mitigate data imbalance, we utilize the Equalized Focal Loss (EFL) function, which employs a category-specific modulating factor to dynamically equilibrate the learning focus across different classes. Comprehensive benchmarking reveals state-of-the-art performance, achieving mAP@0.5 scores of 95.7% on the standard PKU-MARKET-PCB dataset and 54.2% on the highly challenging CPS2D-AD dataset. Significantly, our approach effectively mitigates class imbalance, narrowing the performance deviation of rare categories to just 4.3% on the PKU-Market-PCB dataset and 1.4% on the CPS2D-AD dataset, compared to 11.8% and 7.5% in baseline models. These findings position MulPViT-SimAM as a viable and efficient solution for industrial quality control.
Wang et al. (Mon,) studied this question.