# Solder Joint Defect Detection in the Connectors Using Improved Faster-RCNN Algorithm
## 3 Results
If the loss mutation caused by insufficient batch size (GPU memory limit) is not taken into account, it can be seen that the concussion range of loss in the early training period is reduced to a certain extent after using k-means clustering generates anchor boxes algorithm, and the final loss of network model has no obvious change. A deep learning target detection model usually used the mAP as an index to measure the detection accuracy. By gradually reducing the threshold value of sample classification, the recall rate and corresponding precision of samples under each threshold value were calculated, and the precision-recall curve was drawn, and the area of the curve and the coordinate axis was mapped. The closer the mAP of a network model approaches 1, the higher the accuracy of the current network model will be. Tables 4 and 5 list the mAP and detection accuracy of the network model under different conditions, respectively. Figures 10 and 11 show the precision-recall curves of different training models and the total loss curves in the training process respectively. Figure 12 lists some of typical detection results of the method proposed in this paper. According to the experimental results, the model mAP and detection accuracy are improved to some extent after the training set is enhanced. In the case of using enhanced training set, k-means clustering generates anchor boxes and transfer learning with ResNet-101 both improve the accuracy of model mAP and detection accuracy, among which ResNet-101 plays a more obvious role. The final mAP and detection accuracy of the algorithm proposed are 0.941 and 94%, respectively, which significantly improves the effect of the original Faster-RCNN under the same training set. Figure 9: RPN bounding box regression loss curve. (**a**) Original anchor boxes scale; (**b**) K-means clustering anchor boxes scale. The red curve is the data fitting curve, showing a general downward trend. After 30,000 iterations, the loss of original algorithm is \(2.034\times 10^{-4}\), and the loss after using k-means clustering generates anchor boxes algorithm is \(1.293\times 10^{-4}\). \begin{table}
\begin{tabular}{c c c} \hline \hline  & **mAP** \\ \hline VGG-16 & 0.8364 \\ VGG-16 + data augmentation 1 & 0.8554 \\ VGG-16 + data augmentation + k-means clustering 2 & 0.8670 \\ ResNet-101 + data augmentation 3 & 0.9337 \\ This paper & 0.941 \\ \hline \end{tabular} \({}^{1,2,3}\) Training model using different improved algorithm.  
\end{table} 
Table 4: mAP of original network and different training model. Figure 10: Different training model’s precision-recall curve. (**a**) Faster-RCNN training model without data augmentation; (**b**) Faster-RCNN training model with data augmentation; (**c**) Faster-RCNN training model with data augmentation and k-means clustering; (**d**) Training model with data augmentation and ResNet-101 transfer learning; (**e**) Training model proposed in this paper. Each color represents one type of solder joint and the mAP of each type is shown as the label. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Qualified** & **Multi-tin** & **Less-tin** & **Connected Welding** & **Tin Tip** & **Mean Accuracy** \\ \hline Original & 60\% & 95\% & 65\% & 90\% & 75\% & 77\% \\ Training model 1 & 65\% & 90\% & 70\% & 95\% & 70\% & 78\% \\ Training model 2 & 70\% & 85\% & 70\% & 95\% & 80\% & 80\% \\ Training model 3 & 90\% & 95\% & 90\% & 95\% & 85\% & 91\% \\ This paper & **90\%** & **95\%** & **95\%** & **100\%** & **90\%** & **94\%** \\ \hline \hline \end{tabular} \({}^{1,2,3}\) Training model using different improved algorithm. Corresponds to the number in Table 4.  
\end{table} 
Table 5: Detection accuracy of 5 solder joint types and mean detection accuracy. Figure 11: Different network’s total loss.