# Keypoint-Based Automated Component Placement Inspection for Printed Circuit Boards
## 3 Experimental Results
### Numerical Results and Comparisons  
Table 4 shows the corresponding AP values and F1 scores of the proposed two-stage training process for Model 1 for different components considered in this study. For comparison purposes, the AP values and F1 scores with only a single-stage training process for Model 1 are also included, where the representation learning for the frontend network is omitted. Model 1 with single-stage training can be viewed as the basic keypoint algorithm [21] for object detection. From Table 4, it can be observed that a two-stage training process is able to achieve higher AP values and F1 scores as compared with its single-stage counterpart. This is because the representation learning operations are beneficial for providing robust features for the subsequent heatmap generation and component size estimations. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Model Type** & **Model 1** & **Model 2** & **Model 3** \\ \hline
**Input X Dimension** & 512 \(\times\) 512 \(\times\) 3 & 512 \(\times\) 512 \(\times\) 3 & 512 \(\times\) 512 \(\times\) 3 \\
**Output Y Dimension** & 128 \(\times\) 128 & 128 \(\times\) 128 & 128 \(\times\) 128 \\
**Output S Dimension** & 128 \(\times\) 128 \(\times\) 2 & 128 \(\times\) 128 \(\times\) 2 & 128 \(\times\) 128 \(\times\) 2 \\
**Model Size** & 600,743 & 1,192,623 & 1,644,751 \\
**Model Configuration** & 1 Frontend NN & 1 Frontend NN & 2 Frontend NN \\
\begin{tabular}{l c c} \hline \hline \end{tabular}
\end{table} 
Table 3: The specifications of the proposed NN models for the inspection of five component classes. The model size is defined as the number of weights in the whole model. Comparisons of AP values and F1 scores between Model 1, Model 2, and Model 3 are included in Table 5. The proposed two-stage training process is adopted for the training of all the models. It can be observed from Table 5 that Model 3 has superior AP values and F1 scores relative to Model 2 and Model 1 for many of the component classes. Model 3 has higher accuracy because there is a dedicated frontend NN for each group of components. In contrast, a single frontend NN is shared by all the component classes. Therefore, it would be difficult for Model 2 and Model 1 to carry out accurate detection for each individual component class. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Training Process** & **Inspection Accuracy** & **Screw** & **Mounting Hole** & **Capactor** & **3-Pin Chip** & **8-Pin Chip** \\ \hline Single-Stage & AP & 0.9460 & 0.9316 & 0.9391 & 0.9682 & 0.9665 \\ \([21]\) & F1 & 0.9283 & 0.8876 & 0.8867 & 0.9123 & 0.9055 \\ \hline Two-Stage & AP & 0.9695 & 0.9400 & 0.9532 & 0.9801 & 0.9755 \\ F1 & 0.9482 & 0.8912 & 0.9320 & 0.9429 & 0.9296 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The inspection accuracy of various component classes of Model 1 with single-stage and two-stage training processes. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline \multirow{2}{*}{**Component Class**} & \multicolumn{2}{c}{**Model 1**} & \multicolumn{2}{c}{**Model 2**} & \multicolumn{2}{c}{**Model 3**} \\  & **AP** & **F1** & **AP** & **F1** & **AP** & **F1** \\ \hline Capacitor & 0.9532 & 0.9320 & 0.9739 & 0.9368 & 0.9605 & 0.9363 \\ Screw & 0.9695 & 0.9482 & 0.9709 & 0.9453 & 0.9710 & 0.9435 \\
3-pin Chip & 0.9801 & 0.9429 & 0.9930 & 0.9734 & 0.9925 & 0.9739 \\
8-pin Chip & 0.9755 & 0.9296 & 0.9892 & 0.9662 & 0.9920 & 0.9760 \\ Mounting Hole & 0.9400 & 0.8912 & 0.9437 & 0.9437 & 0.9723 & 0.9545 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The AP values and F1 scores of various component classes for Model 1, Model 2, and Model 3. The two-stage training process is employed for the models. Figure 9: Test PCBs considered in this study. The test images are acquired from the PCBs. Figure 10 reveals the precision-recall curves for all the component classes considered in this study for Model 3 with two-stage training operations. It can be observed from Figure 10 that the proposed algorithm is able to maintain high precision, even with a high recall value.