# Detecting and Measuring Defects in Wafer Die Using GAN and YOLOv3
## 3 Analysis and Results of the Experiments
### Hyperparameter Sensitivity Experiment  
The hyperparameters of a model are related to the flexibility and potential of its learning, and directly influence the degree of the generalization when the model makes inferences. Since training a deep learning model often takes a long time, it is extremely inefficient to find the optimal hyperparameter combination manually for a deep learning model. Based on DOE, the research analyzed the validation AP with various hyperparameter combinations. It endeavored to identify the key hyperparameter combinations that affect the AP of die defect detection, which provides the basis for improving the AP of the model in a reasonable way. The DOE of this research includes four factors, and each factor has three levels. * Input image size of GAN: The quality of the image generated by the GAN is not only influenced by the background complexity of the input image, but also by the size of the input image. If the size is too small, the GAN cannot generate detailed defects; if the size is too large, the GAN would weaken during the generation process. This research set three levels of the factor to be \(28\times 28\), \(64\times 64\), and \(96\times 96\), with \(28\times 28\) as the default value, and \(96\times 96\) the upper limit of the defect size. * Fold size of GAN image augmentation: This study proposed an image augmentation technology based on the GAN. Defect patches were generated from the adversarial learning process. Then the patches were pasted onto the defect-free die image to generate pseudo defect images. Compared with the original defective die images in Figure 5(a1,a2), the defects in Figure 5(b1,b2) were naturally embedded in the die image. This process generated various shapes, sizes and numbers of defects, and increased the quantity of training images and the diversity of defects, allowing YOLOv3 to learn a richer appearance of defects, and improving the performance of model training. In this study, the factors were set to three levels: 1, 1.5, and 2. The 1 meant that the GAN image augmentation mechanism was turned off; 1.5 and 2 meant that the original number of defective die images was multiplied by 1.5 and 2 respectively as the pseudo defective die images for later training. * Upper limit of the input image size: There are only convolutional layers in YOLOv3, and its input image size is unrestricted. However, in order to strengthen the robustness of model inference, YOLOv3 adopted a multiscale training strategy. During the training process, the size of the input image was changed after a certain number of iterations. YOLOv3 could define the upper limit of the size range of the input image during the training process. In addition, because the minimum input feature map in Yoloblock employed downsampling 32 times, the upper limit of the image \begin{table}
\begin{tabular}{c c c} \hline \hline
**Evaluation Metrics Methods** & **Validation AP** & **FPS** \\ \hline YOLOv3 & 81.59\% & 13.447 \\ Faster RCNN & 14.00\% & 2.783 \\ SSD & 57.56\% & 23.852 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Spot-checking comparison using different evaluation metrics. size range must also be a multiple of 32. In the experimental design, the factor was set to three levels: \(416\times 416\), \(480\times 480\), and \(544\times 544\). \(416\times 416\) was the default value of YOLOv3. * Degree of jitter: In addition to the pseudo images generated by the GAN, the YOLOv3 also had its own data augmentation program, called the degree of jitter. It could flip, zoom, crop, and perform HSV contrast conversion of the input image to augment the images and suppress overfitting. This research set the factor to three levels: 0, 0.15, and 0.3. The 0.3 was the default value of YOLOv3, and 0 indicated that the jitter was turned off. Next, this study removed 20% from the training image set to be used as the validation image set (not including any pseudo defective images).