# Application Research of Improved YOLO V3 Algorithm in PCB Electronic Component Detection
## 3 Methodologies
### Network Structure Improvement  
YOLO V3 uses 53-layer Darknet-53 as the feature extractor. The two most important parts of Darknet-53 are convolutional and resnet. Here, the \(1\times 1\) convolution can compress the number of feature map channels to reduce the model calculation and parameters. Multiple \(3\times 3\) convolution layers are more nonlinear than a large filter convolution layer, making the decision function more decisive. Resnet can make the network deeper, faster, easier to optimize, with fewer parameters and lower complexity than previous models. Therefore, it can solve the problem of deep network degradation and training difficulty. Darknet-53 performs a total of five dimensionality reduction operations. The number of rows and columns which belong to the feature matrix of each dimension reduction output becomes half while the depth doubles compared with the previous. Figure 5 shows the corresponding feature output of different reduction dimension modules of the entire Darknet-53.  
Through the Darknet-53 feature output diagram, we can see that each pixel on the feature map of different layers represents the different sizes of the original image. For example, each pixel in the image \(104\times 104\times 128\) represents the size \(4\times 4\) of the original \(416\times 416\) image. At the same time, each pixel in the image \(13\times 13\times 1023\) represents the size \(32\times 32\) of the original \(416\times 416\) image. For this reason, YOLO V3 chose \(52\times 52\times 256\), \(26\times 26\times 512\) and \(13\times 13\times 1024\), three feature output layers for upsampling and feature fusion to detect large, medium and small objects of different sizes. As we found in the previous statistical analysis, in the PCB electronic component identification task, the number of SMD much like resistor, capacitor and LED (Light-emitting diode), is large, while the size is small. Each training picture has different resolutions and different sizes due to different acquisition methods. Before training, YOLO V3 resizes the size of pictures to \(416\times 416\). This is often done for the label content in the original image with compression processing and the detection target of a small size will become smaller. If only the deep feature output of Darknet-53 is selected for training and learning, the small size components will lose feature information. Therefore, to improve the accuracy of target detection, we must add a shallow layer feature output to the component category judgment and positioning based on the original YOLO layer. The improved YOLO V3 network structure is shown in Figure 6.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Image of ML365\_Top** & **Labeled Components** & \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} Bottom 18 \\ \(148\times 147\) \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} Display 0 \\ \(661\times 1466\) \\ \end{tabular} } \\  & & \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} Ic 159 \\ \(140\times 182\) \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} Connector 248 \\ \(170\times 173\) \\ \end{tabular} } \\  & & \\ \hline \hline \multirow{2}{*}{\
\begin{tabular}{c} Red49 \\ \(49\times 27\) \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} Switch 6 \\ \(193\times 192\) \\ \end{tabular} } \\  & & \\ \hline \hline \end{tabular}
\end{table}
Table 2: Statistical analysis table of PCB-labeled electronic components image size.  
_Appl. Sci._**2019**, 9, 3750  
Figure 5: Darknet-53 feature output schematic.