Zero-shot printed circuit board defect detection via optical flow and reconstruction guidance
Deep learning is widely used in printed circuit board (PCB) defect detection, owing to its excellent performance. Different types and styles of PCBs exist, for application in different fields and scenarios, making it necessary to fine-tune model on unseen PCB types to maintain detection performance. Few-shot learning methods reduce the cost of data collection and annotation, as they require fewer samples. Under ideal circumstances and with standardized electronic components, image differencing techniques can highlight defects by comparing test images with defect-free reference images, making them category-agnostic, generalizable, and highly interpretable. However, they require careful image preprocessing and parameter selection, and fail if the images are misaligned. To address this issue, while preserving the generalizability of image differencing, we propose a method for PCB defect detection by simulating image differencing using a neural network comprising a shared encoder and three decoders for different tasks: (1) The flow decoder outputs an optical flow displacement field to align image pairs and guides the encoder to learn pixel correspondence relationships, (2) The reconstruction decoder guides the encoder to focus on perceiving the discrepancies between images. (3) The mask decoder locates defective areas with significant visual discrepancies between images. We train the network exclusively on synthetic data and then test it on the publicly available datasets, DeepPCB, PCBS, and MVTec AD, achieving results comparable to that of supervised learning with numerous real samples. Ablation experiments demonstrate that optical flow and reconstruction guidance can effectively enhance the robustness of the network. • An optical flow-reconstruction guided network for detection robustness is proposed. • A data synthesis strategy proposed for image alignment and difference detection. • Competitive results on public and real-world data exhibit strong generalization.
Authors
- Ting Shen (ORCID: https://orcid.org/0009-0001-2189-3114)
- Xinghang Yin
- Yongxu Liu (ORCID: https://orcid.org/0009-0008-5719-1107)
- Shuxia Wang
- Yue Wang (ORCID: https://orcid.org/0000-0002-0981-935X)
- Peng Wang (ORCID: https://orcid.org/0000-0003-4250-8104)
- Haidong Qiao (ORCID: https://orcid.org/0000-0002-3797-9406)
Institutions
- Chongqing University of Posts and Telecommunications (CN)
- Northwestern Polytechnical University (CN)
Publication Details
- Journal
- Computers in Industry
- Published
- 2025-09-25
- DOI
- https://doi.org/10.1016/j.compind.2025.104355
- Citations
- 2
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 2.48