# Detecting and Measuring Defects in Wafer Die Using GAN and YOLOv3
## 1 Introduction  
Wafer is the major material for making integrated circuits (ICs), and it plays an indispensable role in electronic products. The upstream of the semiconductor industry are IC design companies and silicon wafer manufacturing companies. IC design companies design circuit diagrams according to customer needs, while silicon wafer manufacturing companies use polysilicon as the raw material for silicon wafers. The primary task of IC manufacturing companies in the midstream is to transfer the circuit diagrams to wafers. The completed wafer is then sent to the downstream IC packaging and testing companies for packaging and testing the functions of ICs, concluding the whole manufacturing process. With the continuous evolution of wafer manufacturing technology, wafer sizes have become larger and the patterns on the die have become more diverse. In order to inspect surface defects in the dies of a wafer, automated optical inspection (AOI), mainly using one or more optical imagery charge-coupled devices (CCDs), has gradually replaced traditional manual visual inspection (VI). The current die AOI inspection methods of die inspection can be divided into design-rule checking [1; 2], neural network [3; 4; 5], golden template method [6; 7], and golden template self-generating method [8; 9]. Design-rule checking is also known as the \"knowledge database method\". [PERSON] and [PERSON] [1] and [PERSON] et al. [2] found the geometric features and textural features of the components on the dies and stored them in the knowledge library, and then compared the features to determine whether they are defective or not. Neural network methods learn the mapping relationship between die features and defect classes throughout learning their synaptic weights. [PERSON] et al. [3] cut the die images into several windows of fixed size, and extracted the corresponding average gray value as features, and then established the back-propagation neural network (BPNN), the radial basis function neural network (RBFNN), and the learning vector quantization neural network (LVQNN) models. [PERSON] et al. [4] used the kmeans to distinguish the P-electrode, the light-emitting area, and the background in the LED die. Then they extracted the geometric features and the textural features from the P-electrode and the light-emitting area, and distinguished the defects using the LVQNN. [PERSON] and [PERSON] [5] used radially encoded features to measure the discontinuity around the P-electrode of the LED die. Since there were relatively few defects, an anomaly detection method such as the one-class support vector machine (SVM) could obtain extremely high classification accuracy. However, the geometric features and appearance of various die images are quite different. It is difficult to find effective handcrafted features and establish criteria. Golden template method is also called the \"image-to-image reference method\". This method compares the golden template with the image to be inspected, and the areas with significant differences are regarded as the ones where the defects may occur. [PERSON] et al. [6] used the golden template method to highlight defects and measure the size, shape, location, and color of the defects, and then distinguished the types of defects based on design-rule checking. [PERSON] et al. [7] cut the boundary between the pads and the dies before establishing a golden template to highlight defects, and then determined the defect types based on features such as location, number of objects, and area of objects. This type of golden template method usually uses pixel-wise difference to identify the difference. Before performing the pixel-wise difference, the image to be inspected must be carefully aligned with the golden template. To alleviate alignment problem, golden template self-generating methods were introduced. [PERSON] et al. [8] used the characteristics of repetitive patterns of the dies in the wafer to self-generate a defect-free template to highlight the defects. [PERSON] et al.