## 3 Experiments and Discussion
### Data and Setup  
In this study, we employed a real-world WBM dataset, WM-811K, for experiments, which is publicly available. WM-811K included 811,457 wafer maps from 46,293 lots, covering nine categories of patterns, and only 172,950 were annotated by experts. The other 638,507 wafer maps are unlabeled WBMs. In our self-supervised pretraining period, 500,000 unlabeled WBMs were used for momentum contrastive learning. The labeled dataset consisted of nine WBM defect types, including eight systematic patterns and one with no systematic pattern (none). The examples of nine existing defect types in WM-811K are shown in Figure 6.  
The WM-811K consists of binary WBMs with only pass (0) or fails dies (1). Each wafer map was treated as a grayscale two-dimensional image. For evaluating the defect classification performance of the proposed method, we compared the proposed method with two existing WBM classification methods. To ensure a fair comparison, the labeled dataset must remain the same in the comparison methods and was split into 0.6:0.4 for training and test set. Table 1 presents the statistics of the labeled dataset.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Defect Type** & **All Numbers** & **Train (0.6)** & **Test (0.4)** & **Percent (\%)** \\ \hline Center & 4294 & 2576 & 1718 & 2.48 \\ Donut & 555 & 333 & 222 & 0.32 \\ Edge-loc & 5189 & 3113 & 2076 & 2.99 \\ Edge-ring & 9680 & 5808 & 3872 & 5.60 \\ Location & 3593 & 2156 & 1437 & 2.08 \\ Near-full & 149 & 89 & 60 & 0.09 \\ Random & 866 & 520 & 346 & 0.50 \\ Scratch & 1193 & 716 & 477 & 0.69 \\ None & 147,431 & 88,459 & 58,972 & 85.25 \\ \hline \end{tabular}
\end{table}
Table 1: WM-811K data description.  
For momentum contrastive learning, we adopted ResNet-18 as the query and key encoder's backbone. In this work, the hyperparameters were chosen by manual tuning. We compared the performance of several common learning rate values: 0.1, 0.01, and 0.001. Moreover, we compared typical batch sizes from a smaller value to the maximum value supported in the memory capacity: 64, 128, and 256. We also compared the performances of several different epochs. When the training loss no longer converged, the epoch was used as the minimum value, and it was increased by 100 sequentially, which was 300, 400, and 500, respectively. Finally, we chose the hyperparameters performing better than other candidates. The learning rate, batch size, and epoch were 0.01, 256, and 500. The encoder's output was a 1000-dimensional embedding. The momentum coefficient \(m\) was set to 0.999, as described in Section 2.2. The length of the queue was 4096, the maximum value supported in the memory capacity. We used SGD as our optimizer. The SGD weight decay was 0.0001. We trained our model on four Nvidia V100 GPUs with 16 GB memory. The data augmentation was rotatedfor random angles.  
For the prototypical-network-based fine-tuning, the hyperparameters were determined by the same approach as contrastive learning. The learning rate, batch size, and epoch were 0.01, 64, and 200. We used SGD as the optimizer. The original WM-811K dataset had 147,431 training data, which was too large for practical purposes. Furthermore, over 85% of these WBMs had no defect pattern (\"none\" type), with only 15% containing specific defect patterns, totaling 15,308 WBMs. We propose to remove the \"none\" type to evaluate the performance of WBMs with specific defect patterns. We focused only on the eight defect categories for classification, significantly reducing the number of training samples. We chose the labeled data from the eight defect categories to create training and testing sets. Moreover, to ensure a fair comparison with existing methods, we also applied nine types of train and test sets to keep the train and test set the same as the comparative methods. The number of support set samples was five, and the number of prototypes were nine and eight, respectively.