RefDiffNet: Learning to Expose Subtle PCB Defects Before Detection
Pith reviewed 2026-06-28 18:47 UTC · model grok-4.3
The pith
RefDiffNet compares each PCB image to an aligned defect-free reference and outputs an enhanced version that highlights defects for any downstream detector.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
RefDiffNet is a lightweight input-enhancement module that receives a defective PCB image and its aligned defect-free reference, isolates the changes relative to the reference through a learned encoder, and returns the original image with defective areas accentuated so that any standard object detector can locate them more reliably.
What carries the argument
Lightweight encoder that encodes the difference between the defective image and the aligned reference to produce a defect-highlighted output image.
If this is right
- Any one-stage, two-stage, or transformer detector receives the same relative improvement without retraining its backbone.
- The added cost stays below 0.25 percent of the host detector's parameter count across the tested families.
- The same block can be inserted before the backbone of detectors not evaluated in the paper.
- Detection of small defects that blend with background traces becomes easier because the reference supplies the expected layout.
Where Pith is reading between the lines
- The method could transfer to other domains that already collect reference images, such as semiconductor wafer inspection or printed-label verification.
- If alignment is learned jointly inside the encoder, the requirement for perfect pre-alignment might be relaxed without losing the performance lift.
- Because the enhancement is detector-agnostic, it might allow smaller or faster base detectors to reach accuracy levels previously requiring larger models.
Load-bearing premise
A perfectly aligned defect-free reference image is available for every inspected PCB.
What would settle it
Running the same detectors with and without RefDiffNet on a test set where reference images are deliberately shifted by a few pixels shows whether the reported gains disappear or reverse.
Figures
read the original abstract
Printed circuit board (PCB) defect detection is challenging because many defects are small and difficult to distinguish from complex background patterns. Most deep learning-based PCB inspection methods rely only on the inspected PCB image for defect detection, ignoring the defect-free reference image that encodes the expected layout of traces, pads, and other PCB structures. In this work, we propose RefDiffNet, a lightweight plug-and-play input enhancement block placed before the detector backbone to enhance the image before defect detection. RefDiffNet brings one proven idea from classical inspection into the deep learning era, using a defect-free reference image to reveal defects. RefDiffNet compares the defective image with the aligned reference, captures structural changes relative to the reference, and uses a lightweight encoder to output the original image with defective regions highlighted, thereby making the downstream detector's task easier. Results on HRIPCB and DeepPCB show that RefDiffNet consistently improves performance across detector families, including one-stage detectors from YOLOv8 to YOLOv26, the transformer-based RT-DETR, and the two-stage Faster R-CNN. It achieves up to 18% relative mAP50:95 gain with negligible overhead, introducing only 0.004 - 0.005M additional parameters and 0.7 - 0.8 GFLOPs, amounting to at most 0.25% of the parameter count of any evaluated detector. Results establish RefDiffNet as a lightweight, plug-and-play, detector-agnostic input enhancement module that substantially improves PCB defect detection with minimal computational cost.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes RefDiffNet, a lightweight plug-and-play input enhancement module placed before a detector backbone. It takes a test PCB image and a defect-free reference image, computes their difference to capture structural changes, encodes the result with a small network, and outputs an enhanced image with defects highlighted. Experiments on HRIPCB and DeepPCB report consistent mAP50:95 gains (up to 18% relative) across YOLO variants, RT-DETR, and Faster R-CNN, with added cost of only 0.004-0.005M parameters and 0.7-0.8 GFLOPs.
Significance. If the reported gains hold under realistic conditions, the work demonstrates a practical, detector-agnostic way to incorporate classical reference-based inspection into modern deep detectors for subtle PCB defects. The negligible overhead and plug-and-play design are clear strengths that could be adopted broadly if robustness is established.
major comments (2)
- [§3] §3 (method description): RefDiffNet is constructed around the assumption of pixel-perfect alignment between the test image and reference; the difference map is fed to the encoder to isolate defects. No experiments, ablations, or stress tests evaluate robustness to realistic misalignment (translation, rotation, or scale offsets typical in production lines), so it is unknown whether the claimed 18% mAP gains survive the registration errors that occur at inference time.
- [§4] §4 (experiments): The evaluation reports gains on HRIPCB and DeepPCB but supplies no details on how reference images were obtained, registered, or whether any misalignment was present or simulated. This leaves the central empirical claim dependent on an untested precondition.
minor comments (2)
- [Abstract, §1] The abstract and §1 could more explicitly state the alignment requirement as a precondition for the method.
- [Figure 2] Figure 2 (architecture diagram) would benefit from explicit notation on the alignment step before subtraction.
Simulated Author's Rebuttal
We thank the referee for the detailed and constructive review. The two major comments correctly identify an important practical consideration for reference-based inspection. We address both below and will incorporate the requested clarifications and experiments in the revised manuscript.
read point-by-point responses
-
Referee: [§3] §3 (method description): RefDiffNet is constructed around the assumption of pixel-perfect alignment between the test image and reference; the difference map is fed to the encoder to isolate defects. No experiments, ablations, or stress tests evaluate robustness to realistic misalignment (translation, rotation, or scale offsets typical in production lines), so it is unknown whether the claimed 18% mAP gains survive the registration errors that occur at inference time.
Authors: We agree that the current method description in §3 presupposes aligned inputs, consistent with the classical reference-based inspection paradigm and with the wording “aligned reference” used throughout the manuscript. Because no misalignment experiments appear in the original submission, the robustness claim cannot be substantiated from the existing results. In the revision we will add a dedicated ablation subsection that introduces controlled misalignment (translations of 0–8 pixels, rotations of 0–3°, and isotropic scale factors of 0.98–1.02) on both HRIPCB and DeepPCB, reporting mAP50:95 for each detector with and without RefDiffNet. We will also discuss whether a lightweight pre-registration step (e.g., phase-correlation) can be inserted before RefDiffNet without materially increasing the reported overhead. revision: yes
-
Referee: [§4] §4 (experiments): The evaluation reports gains on HRIPCB and DeepPCB but supplies no details on how reference images were obtained, registered, or whether any misalignment was present or simulated. This leaves the central empirical claim dependent on an untested precondition.
Authors: The original §4 indeed omits explicit description of reference-image provenance and registration. Both datasets supply paired defect-free references that were already aligned by the dataset creators; however, the manuscript does not state this or quantify residual registration error. In the revision we will expand the dataset subsection of §4 with: (i) the exact source of each reference image, (ii) the registration procedure reported by the dataset authors, and (iii) a short statement that all reported numbers assume the provided alignment. The new misalignment experiments described in the response to comment [§3] will further quantify sensitivity to deviations from that alignment. revision: yes
Circularity Check
No circularity; claims rest on empirical results with no self-referential derivations
full rationale
The paper presents RefDiffNet as an empirical input-enhancement module whose value is demonstrated solely through reported mAP gains on HRIPCB and DeepPCB across multiple detectors. No equations, first-principles derivations, fitted parameters renamed as predictions, or load-bearing self-citations appear in the provided text. The central claim (performance improvement with negligible overhead) is therefore independent of any circular reduction and is evaluated against external benchmarks.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption Aligned defect-free reference images are available for every test PCB
Reference graph
Works this paper leans on
-
[1]
Xing Chen, Yonglei Wu, Xingyou He, and Wuyi Ming. A comprehensive review of deep learning-based pcb defect detection.IEEE Access, 11:139017–139038, 2023. doi: 10.1109/ACCESS.2023.3339561
-
[2]
A high-accuracy pcb defect detection algorithm based on improved yolov12.Symmetry, 17(7), 2025
Zhi Chen and Bingxiang Liu. A high-accuracy pcb defect detection algorithm based on improved yolov12.Symmetry, 17(7), 2025. ISSN 2073-8994. doi: 10.3390/ sym17070978. URLhttps://www.mdpi.com/2073-8994/17/7/978
2025
-
[3]
Audrey Chung, Francis Li, Jeremy Ward, Andrew Hryniowski, and Alexander Wong. Dvqi: A multi-task, hardware-integrated artificial intelligence system for automated visual inspection in electronics manufacturing, 2023. URLhttps://arxiv.org/ abs/2312.09232
-
[4]
Yu-Shan Deng, An-Chun Luo, and M. J. Dai. Building an automatic defect verification system using deep neural network for pcb defect classification.2018 4th International Conference on Frontiers of Signal Processing (ICFSP), pages 145–149, 2018. URL https://api.semanticscholar.org/CorpusID:54215616
2018
-
[6]
URLhttps://ietresearch.onlinelibrary.wiley.com/doi/ abs/10.1049/joe.2019.1188
-
[7]
Georgios D. Evangelidis and Emmanouil Z. Psarakis. Parametric image alignment using enhanced correlation coefficient maximization.IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(10):1858–1865, 2008. doi: 10.1109/TPAMI. 2008.113
-
[8]
Pcb defect detection via local detail and global dependency information.Sensors, 23(18):7755, 2023
Bo Feng and Jian Cai. Pcb defect detection via local detail and global dependency information.Sensors, 23(18):7755, 2023. doi: 10.3390/s23187755
-
[9]
Changechip: A reference- based unsupervised change detection for pcb defect detection, 2021
Yehonatan Fridman, Matan Rusanovsky, and Gal Oren. Changechip: A reference- based unsupervised change detection for pcb defect detection, 2021. URLhttps: //arxiv.org/abs/2109.05746
-
[10]
Zihan He, Yudong Lian, Yulei Wang, and Zhiwei Lu. A comprehensive review of research on surface defect detection of pcbs based on machine vision.Results in Engi- neering, 27:106437, 07 2025. doi: 10.1016/j.rineng.2025.106437
-
[11]
Coordinate attention for efficient mobile network design
Qibin Hou, Daquan Zhou, and Jiashi Feng. Coordinate attention for efficient mobile network design. InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 13713–13722, 2021
2021
-
[12]
Yingqiang Hou and Xindong Zhang. A lightweight and high-accuracy framework for printed circuit board defect detection.Engineering Applications of Artificial Intelli- gence, 148:110375, 2025. doi: 10.1016/j.engappai.2025.110375. 16REFDIFFNET: LEARNING TO EXPOSE SUBTLE PCB DEFECTS BEFORE DETECTION
-
[13]
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient con- volutional neural networks for mobile vision applications, 2017. URLhttps: //arxiv.org/abs/1704.04861
work page internal anchor Pith review Pith/arXiv arXiv 2017
-
[14]
Squeeze-and-excitation networks
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7132–7141, 2018
2018
-
[15]
Weibo Huang, Peng Wei, Manhua Zhang, and Hong Liu. Hripcb: a chal- lenging dataset for pcb defects detection and classification.The Journal of Engineering, 2020(13):303–309, 2020. doi: https://doi.org/10.1049/joe.2019
-
[16]
URLhttps://ietresearch.onlinelibrary.wiley.com/doi/ abs/10.1049/joe.2019.1183
-
[17]
Wavelet-based printed circuit board inspection algorithm.Integrated Computer-Aided Engineering, 12:201–213, 04 2005
Zuwairie Ibrahim and Syed Al-Attas. Wavelet-based printed circuit board inspection algorithm.Integrated Computer-Aided Engineering, 12:201–213, 04 2005. doi: 10. 3233/ICA-2005-12206
2005
-
[18]
S.H Indera Putera and Z. Ibrahim. Printed circuit board defect detection using math- ematical morphology and matlab image processing tools. In2010 2nd International Conference on Education Technology and Computer, volume 5, pages V5–359–V5– 363, 2010. doi: 10.1109/ICETC.2010.5530052
-
[19]
In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)
Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition? In2009 IEEE 12th Interna- tional Conference on Computer Vision, pages 2146–2153, 2009. doi: 10.1109/ICCV . 2009.5459469
-
[20]
Ultralytics yolo26, 2026
Glenn Jocher and Jing Qiu. Ultralytics yolo26, 2026. URLhttps://github. com/ultralytics/ultralytics
2026
-
[21]
YOLOv11: An Overview of the Key Architectural Enhancements
Rahima Khanam and Muhammad Hussain. Yolov11: An overview of the key architec- tural enhancements, 2024. URLhttps://arxiv.org/abs/2410.17725
work page internal anchor Pith review Pith/arXiv arXiv 2024
-
[22]
Selective kernel networks
Xiang Li, Wenhai Wang, Xiaolin Hu, and Jian Yang. Selective kernel networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 510–519, 2019
2019
-
[23]
JiaYou Lim, JunYi Lim, Vishnu Monn Baskaran, and Xin Wang. A deep context learn- ing based pcb defect detection model with anomalous trend alarming system.Results in Engineering, 17:100968, 2023. doi: 10.1016/j.rineng.2023.100968
-
[24]
Qin Ling and Nor Ashidi Mat Isa. Printed circuit board defect detection methods based on image processing, machine learning and deep learning: A survey.IEEE Access, 11: 15921–15944, 2023. doi: 10.1109/ACCESS.2023.3245093
-
[25]
Zhigang Ling, Aoran Zhang, Dexin Ma, Yuxin Shi, and He Wen. Deep siamese se- mantic segmentation network for pcb welding defect detection.IEEE Transactions on Instrumentation and Measurement, 71:1–11, 2022. doi: 10.1109/TIM.2022.3154814. REFDIFFNET: LEARNING TO EXPOSE SUBTLE PCB DEFECTS BEFORE DETECTION17
-
[26]
Yolo-bfrv: An efficient model for detecting printed circuit board defects.Sensors, 24:6055, 09 2024
Jiaxin Liu, Bingyu Kang, Chao Liu, Xunhui Peng, and Yan Bai. Yolo-bfrv: An efficient model for detecting printed circuit board defects.Sensors, 24:6055, 09 2024. doi: 10.3390/s24186055
-
[27]
Tao Luo, Yongbing Zhou, Donglin Shi, Qinglin Yun, Shuying Wang, Jian Zhang, and Guofu Ding. A lightweight defect detection transformer for printed circuit boards combining image feature augmentation and refined cross-scale feature fu- sion.Engineering Applications of Artificial Intelligence, page 111128, 2025. doi: 10.1016/j.engappai.2025.111128
-
[28]
Detrs beat yolos on real-time object detection, 2023
Wenyu Lv, Shangliang Xu, Yian Zhao, Guanzhong Wang, Jinman Wei, Cheng Cui, Yuning Du, Qingqing Dang, and Yi Liu. Detrs beat yolos on real-time object detection, 2023
2023
-
[29]
Torchvision: Pytorch’s computer vision library.https://github.com/pytorch/vision, 2016
TorchVision maintainers and contributors. Torchvision: Pytorch’s computer vision library.https://github.com/pytorch/vision, 2016
2016
-
[30]
Yilin Miao, Zhewei Liu, Xiangning Wu, and Jie Gao. Cost-sensitive siamese net- work for pcb defect classification.Computational Intelligence and Neuroscience, 2021(1):7550670, 2021. doi: https://doi.org/10.1155/2021/7550670. URLhttps: //onlinelibrary.wiley.com/doi/abs/10.1155/2021/7550670
-
[31]
Detection of bare pcb defects by image subtraction method using machine vision.Proceedings of the World Congress on Engineering 2011, WCE 2011, 2, 07 2011
Ajay Pal, Singh Chauhan, and Sharat Bhardwaj. Detection of bare pcb defects by image subtraction method using machine vision.Proceedings of the World Congress on Engineering 2011, WCE 2011, 2, 07 2011
2011
-
[32]
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real- time object detection with region proposal networks, 2016. URLhttps://arxiv. org/abs/1506.01497
work page internal anchor Pith review Pith/arXiv arXiv 2016
-
[33]
Online PCB Defect Detector On A New PCB Defect Dataset
Sanli Tang, Fan He, Xiaolin Huang, and Jie Yang. Online pcb defect detector on a new pcb defect dataset, 2019. URLhttps://arxiv.org/abs/1902.06197
work page internal anchor Pith review Pith/arXiv arXiv 2019
-
[34]
YOLOv12: Attention-Centric Real-Time Object Detectors
Yunjie Tian, Qixiang Ye, and David Doermann. Yolov12: Attention-centric real-time object detectors, 2025. URLhttps://arxiv.org/abs/2502.12524
work page internal anchor Pith review Pith/arXiv arXiv 2025
-
[35]
Yolov8: A novel object detection algorithm with enhanced performance and robustness
Rejin Varghese and Sambath M. Yolov8: A novel object detection algorithm with enhanced performance and robustness. In2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS), pages 1–6, 2024. doi: 10.1109/ADICS58448.2024.10533619
-
[36]
Yolov10: Real-time end-to-end object detection,
Ao Wang, Hui Chen, Lihao Liu, Kai Chen, Zijia Lin, Jungong Han, and Guiguang Ding. Yolov10: Real-time end-to-end object detection, 2024. URLhttps:// arxiv.org/abs/2405.14458
-
[37]
Chien-Yao Wang, I-Hau Yeh, and Hong-Yuan Mark Liao. Yolov9: Learning what you want to learn using programmable gradient information, 2024. URLhttps: //arxiv.org/abs/2402.13616
-
[38]
Eca-net: Efficient channel attention for deep convolutional neural networks
Qilong Wang, Banggu Wu, Pengfei Zhu, Peihua Li, Wangmeng Zuo, and Qinghua Hu. Eca-net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 11534–11542, 2020. 18REFDIFFNET: LEARNING TO EXPOSE SUBTLE PCB DEFECTS BEFORE DETECTION
2020
-
[39]
Cbam: Con- volutional block attention module
Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Con- volutional block attention module. InProceedings of the European Conference on Computer Vision (ECCV), pages 3–19, 2018
2018
-
[40]
Pcb defect detection algorithm based on cdi-yolo.Scientific Reports, 14, 03 2024
Gaoshang Xiao, Shuling Hou, and Huiying Zhou. Pcb defect detection algorithm based on cdi-yolo.Scientific Reports, 14, 03 2024. doi: 10.1038/s41598-024-57491-3
-
[41]
Feifan Yi, Ahmad Sufril Azlan Mohamed, Mohd Halim Mohd Noor, Fakhrozi Che Ani, and Zol Effendi Zolkefli. Yolov8-dee: A high-precision model for printed circuit board defect detection.PeerJ Computer Science, 10:e2548, 2024. doi: 10.7717/peerj-cs. 2548
-
[42]
Renjie Zhang, Yanjue Gong, Fu Zhao, and Jinkai Fan. Msa-detr: Multi-scale alignment detection transformer for pcb defect detection with enhanced cross-scale feature fusion. Measurement Science and Technology, 36:125401, 2025. doi: 10.1088/1361-6501/ ae2152
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.