# Keypoint-Based Automated Component Placement Inspection for Printed Circuit Boards
## 1 Introduction  
With the increasing popularity of consumer electronics products, such as laptops, smartphones, display cards, and tablets, high-quality printed circuit board (PCB) manufacturing is important. Because of this surge in the demand for PCBs in the market, manufacturers are required to produce PCBs in large quantities. However, maintaining the quality of such large numbers of PCBs is challenging. With the advent of computer vision [1] and artificial intelligence [2] techniques, automated computer visual inspection methods are found to be beneficial in terms of improving the performance for high-volume industrial production. One typical approach for automated computer visual inspection is based on the template-matching method [3; 4; 5] with a flaw-free reference. Basic template-based approaches accomplish defect detection by measuring the similarity (or dissimilarity) between the given test image and the reference. A common drawback of some template-matching approaches is that proper alignment between the test image and the template is desired for the correlation computation. However, for many applications, the enforcement of alignment operations may be difficult, resulting in degradation in detection accuracy. Furthermore, some of these technique focus only on the inspection of solder joints or bare PCBs without components. Nevertheless, component placement inspection is a significant and challenging problem for PCB manufacturing. Many defects are caused by errors in PCB component placement, such as missing or misaligned components or the incorrect rotation of the components. Automated component placement inspection on a PCB can be achieved by the employment of semantic segmentation or object detection methods. Semantic segmentation techniques [6; 7] aim to separate images under examination into regions. Each individual region belongs to an independent component on PCB [8; 9]. One challenging issue for segmentation-based methods is the dense and/or uneven distributions of components on a board. It may be difficult to detect a component in a densely populated region on the PCB [8; 9]. In addition, large varieties of components may further degrade the accuracy of component detection. For components with small sizes, lower segmentation accuracy may be introduced due to the class-imbalanced problem [10; 11]. Therefore, it would be difficult to adopt segmentation-based surface defect detection techniques [12] for component placement inspection. Region-based convolutional neural networks (CNNs) [13; 14; 15; 16] for object detection have also been found to be effective. Many such techniques attain high detection accuracy by employing anchor boxes as detection candidates [17; 18; 19]. Anchor boxes are boxes of various sizes and aspect ratios. A large set of anchor boxes [11] may be required for accurate detection. Subsequently, high computation overhead is usually introduced for both training and inference. In addition, expensive manual labeling efforts are required when components are varied [20]. An alternative to anchor-based approaches is to represent each object as a single [21] or multiple key points [22; 23]. For techniques with a single keypoint, the keypoint of an object is the center of the bounding box of the object. When an object is represented by a pair or a triplet of keypoints, each keypoint represents the center or corners of the bounding box. The corresponding object detection operations are equivalent to finding the keypoints of the objects. The need for anchor boxes is then bypassed. In addition to keypoint-based approaches, neural network (NN) models with a transformer attention mechanism [24; 25; 26] have been found to be effective for object detection. The employment of transformer attention is beneficial for exploring the spatial correlation for accurate detection of objects. Nevertheless, NN models such as DETR [24] require a high level of network complexity to carry out transformer attention operations. High computation time and large memory sizes are then needed for inference operations.