Source-linked AI summary
Quality Inspection of Printed Circuit Board Pin Insertion via Semantic Segmentation and Board-Level Feature Extraction
Nils Rabeneck, André Kiunke, Nicole Hoess, Wolfgang Mauerer
TL;DR
Misaligned pins are difficult to inspect reliably after PCB pin insertion, a gap associated with manufacturing quality concerns. The paper combines U-Net semantic segmentation with contour-feature extraction and logistic regression for board-level classification, comparing the approach with alternative inspection methods. It reports ROC-AUC values of 0.990 and 1.000 on industrial and public test datasets, respectively.
Problem
Misaligned pin detection during or after PCB pin insertion is comparatively underexplored despite its relevance to PCB quality and manufacturing rework.
Method
The pipeline uses U-Net semantic segmentation, contour-based feature extraction, and logistic regression to classify boards as pass or fail.
Results
The decision function achieved 0.990 ROC-AUC on the industrial test dataset and 1.000 ROC-AUC on the public test dataset.
Takeaways & Limitations
The method is presented as a promising candidate for automated pin inspection across industrial and publicly available PCB image datasets.
Abstract
from arXiv · showhide
Quality control during printed circuit board (PCB) assembly is a critical step in ensuring reliable electronic products. Detecting misaligned pins during or after pin insertion remains a particularly challenging inspection task. This paper presents an automated defect detection method for identifying incorrectly inserted pins on PCBs. The proposed pipeline combines semantic segmentation using a U-Net architecture with contour-based feature extraction and logistic regression for board-level pass/fail classification. Segmentation masks are used to derive contour representations of individual pins, from which board-level features -such as average contour size- are extracted and used to train a logistic regression classifier. We evaluate the method on two datasets: an industrial collection of real-world PCB images, and a publicly available PCB pin-inspection dataset with substantially different visual characteristics. To assess the effectiveness of the proposed approach, a comparison against PatchCore, an anomaly detection technique new to be applied to pin inspection, as well as instance segmentation-based pin detection is made. The developed method achieved Area Under the Receiver Operating Characteristic Curve (ROC-AUC) values of 0.990 on a random test set split from the industrial data and 1.000 on the public dataset indicating strong separation between pass and fail boards. The results indicate that the proposed approach is a promising candidate for automated pin inspection in industrial environments and achieves strong performance on datasets with substantially different visual characteristics after dataset-specific training.
I. INTRODUCTION
PCB pin inspection remains comparatively underexplored despite the quality and manufacturing costs associated with misaligned pins. This work develops and evaluates a segmentation-based, board-level pass/fail pipeline, including comparisons across datasets and alternative methods.
- Misaligned pin detection is comparatively less studied than other PCB defects and can increase quality issues, rejection rates, and rework costs.
- The method targets tilted pins during or immediately after insertion using deep-learning semantic segmentation and board-level classification.
- Semantic segmentation provides pin contours and contour-based features for classifying PCB images as pass or fail.
- The study investigates semantic segmentation, contour-feature classification, and comparisons with anomaly detection and object detection approaches.
- The methods are evaluated on industrial and public datasets, with a self-contained reproduction package provided for further development.
II. RELATED WORK
Prior PCB inspection research often uses dedicated imaging or handcrafted procedures and emphasizes insertion-process support rather than post-insertion quality assessment. Robust automated detection of pin alignment defects therefore remains insufficiently explored.
- Published methods detect pin defects indirectly through sensory outputs or failed insertion, rather than directly evaluating tilted pins after insertion.
- A publicly available Roboflow dataset contains annotated YOLO instance-segmentation data for PCB pin detection but lacks an accompanying peer-reviewed publication.
- Many pin-inspection solutions rely on dedicated imaging setups, fixed conditions, or handcrafted inspection procedures.
- Existing CNN-based approaches predominantly support the pin insertion process rather than assess the quality of inserted pins.
III. METHOD
The proposed method represents pin geometry through semantic segmentation, contour extraction, and board-level features. It is developed using industrial PCB images containing many pins and multiple pin geometries.
- Semantic segmentation produces pixel-accurate pin representations whose contours and geometric features support board-level logistic regression.
- The industrial dataset contains 827 grayscale PCB images at 4096×3000 pixels, with approximately 350 pins per image.
- The industrial images include pass and defective boards, with three pin geometries annotated as one pin class for localisation.
B. Semantic Segmentation
The segmentation and classification workflow converts predicted pin masks into contour features and combines them in a logistic function for board-level pass/fail decisions. Threshold selection prioritizes preventing failed boards from passing and detecting failed boards.
- Six pass and six fail images were manually annotated, then divided into patches to produce 576 training images and masks for U-Net.
- Contour analysis computes contour area, bounding-box aspect ratio, and contour count from predicted masks.
- Because misaligned pins typically have larger areas, area-based features and contour count are used to train the board-level decision function.
- Logistic regression combines multiple board features because individual feature thresholds could not reliably separate defective and non-defective boards.
- Decision thresholds prioritize pass precision, fail recall, fail precision, and then pass recall.
E. Experimental Overview
The experiments evaluate the proposed semantic-segmentation and contour-based classification method alongside PatchCore and YOLO-based inspection alternatives.
- The first two experiments evaluate the proposed method, while the latter two contextualize it against alternative inspection approaches.
- Four experiments assess semantic segmentation, the proposed board-level classifier, PatchCore anomaly detection, and YOLO baselines.
- PatchCore was selected because it can be trained using defect-free samples without pixel-level annotations.
- YOLO instance segmentation was selected because the public Roboflow dataset provides annotations in the corresponding format.
A. PatchCore-Based Anomaly Detection
PatchCore provides a defect-free-training anomaly-detection baseline, while YOLO-based models provide supervised pin-level alternatives with dataset-specific implementation constraints.
- PatchCore compares test-image local features with stored non-defective features, assigning high anomaly scores to regions with large nearest-feature distances.
- The industrial PatchCore pipeline applies YOLOv8 localization before anomaly detection, so it depends on both crop quality and PatchCore decisions.
- PatchCore training used 108 manually segmented non-defective industrial crops, while evaluation included 148 non-defective and 44 defective candidates.
- YOLO instance segmentation used reviewed two-class annotations and preserved polygon representations to retain individual-pin shape and extent information.
- The Roboflow YOLO experiment contained only one defective test image, so its performance metrics require appropriate caution.
V. RESULTS
U-Net produced the strongest overall segmentation results and supported contour-based board classification, which achieved high ROC-AUC values on both datasets.
- U-Net achieved the best overall segmentation performance, although DeepLabV3 achieved higher recall, and was selected for subsequent processing.
- 0.990 ROC-AUC was achieved by the logistic decision function using contour features from U-Net masks on the industrial data.
- The industrial classifier used average contour area, area standard deviation, maximum contour area, mean aspect ratio, and contour count, with a 0.430 decision threshold.
- Fail boards received lower pass probabilities than pass boards, and the selected threshold separated all fail boards from most pass boards.
- 1.000 ROC-AUC was achieved on the Roboflow dataset, with the maximum contour having the largest coefficient impact.
- 18.0 s was the average processing time for a 4096×3000 board image, including segmentation, contour extraction, feature computation, and classification.
- Feature extraction and classification required approximately 0.23 s per board, while semantic segmentation accounted for most processing time.
B. PatchCore Baseline Results
The classification-results table compares the proposed approach with PatchCore across industrial and Roboflow pin-nest test sets.
- Table II reports classification metrics for the proposed approach and PatchCore on industrial and Roboflow pin-nest-level test sets.
- The selected PatchCore configuration used a WRN50-2 backbone.
C. YOLO Baseline Results
The YOLOv8s-seg baseline was evaluated on Roboflow data, with results reported overall and by class to expose class-imbalance effects. Correct pins were segmented more reliably than tilted pins.
- YOLO Baseline Results: Fig. 3 shows an original Roboflow image, its predicted mask, and an overlay.
- YOLO Baseline Results: Table III reports patch-based YOLOv8s-seg performance on the Roboflow validation and test splits using the default confidence threshold.Results are provided both overall and by class.
- YOLO Baseline Results: Class-wise reporting makes the effect of the strong class imbalance visible in the Roboflow evaluation.
- YOLO Baseline Results: Correct pins were segmented substantially more reliably than tilted pins.
VI. DISCUSSION
The proposed feature-based method performed well for PCB quality assurance, while comparisons with YOLO and PatchCore were constrained by differing data, labels, tasks, and class imbalance.
- VI. DISCUSSION: U-Net achieved high IoU for pin segmentation on both datasets, although DeepLab achieved better recall.
- VI. DISCUSSION: The proposed semantic-segmentation and feature-analysis method performed well for PCB quality assurance based on pin-tilting defects.
- VI. DISCUSSION: PatchCore achieved promising results on both datasets with less labeling effort, but it does not provide board-specific features.PatchCore supports anomaly localization through anomaly heatmaps.
- VI. DISCUSSION: YOLO instance-segmentation performance was excellent on Roboflow data but not promising on industrial data, showing stronger dependence on data and annotations.
- VI. DISCUSSION: The alternative methods are complementary references rather than directly comparable benchmarks because they use different data, labeling requirements, and task levels.The proposed method operates at board level, PatchCore at nest level, and YOLO at pin level.
VII. CONCLUSION
The paper presents a U-Net segmentation, contour-feature, and logistic-classification pipeline for board-level detection of misaligned pin-insertion defects. It reports strong ROC-AUC separation on industrial and public test datasets, while noting dataset-related limits on statistical significance.
- VII. CONCLUSION: The proposed pipeline combines U-Net semantic segmentation, contour detection, feature extraction, and logistic classification for board-level pass/fail decisions.
- VII. CONCLUSION: 0.990 ROC-AUC on the industrial test dataset and 1.000 ROC-AUC on the public test dataset indicate strong separation between pass and fail boards.
- VII. CONCLUSION: The public test set contains only a small number of defective boards, limiting the statistical significance of reported fail-class performance.
- VII. CONCLUSION: PatchCore achieved precision and recall comparable to the proposed method, while instance-segmentation performance differed substantially between datasets.