## 3 Experiments and Discussion
### Overall Framework Performance Evaluation  
To evaluate the performance of the proposed framework, we used 500,000 unlabeled data in WM-811K for momentum contrastive learning. The labeled training set was used to fine-tune the query encoder for classification based on the prototypical network. After  
Figure 6: The examples of 9 defect types in the WM-811K dataset. fine-tuning, the labeled test set was used to test the classification performance, reflecting the overall framework's performance. We compared the proposed framework with an existing WBM classification method based on self-supervised learning and few-shot learning [38] (refers to \"ICCAD'21\"). The proposed framework consists of a shared backbone and two branches for the few-shot and self-supervised learners. This method is an end-to-end framework with two jointly performed tasks sharing the same wafer pattern feature extractor. The loss function combined the few-shot and self-supervised learner loss, constituting a total loss function. Unlike ICCAD'21, our proposed framework is a two-stage method using a self-supervised learner for model pretraining and a few-shot learner for fine-tuning. Another existing deep-learning-based wafer defect classification method proposed in [41] was also compared with our proposed framework (refers to \"DAC'20\"). In [41], deep selective learning was exploited with distinct coverage on the testing dataset for the defect pattern classification. For a fair comparison, the train and test sets of the three comparative methods were the same. We calculated precision, recall, and f1-score to evaluate classification performance. The calculation function of the three indexes is as follows:  
\[Precision=\frac{TP}{TP+FP} \tag{6}\]  
\[Recall=\frac{TP}{TP+FN} \tag{7}\]  
\[f\text{1-}score=\frac{2*Precision*Recall}{Precision+Recall} \tag{8}\]  
where \(TP\) is the number of wafer defects of one defect type being correctly classified, \(FP\) is the number of wafer defects of other defect types being classified to one defect type, \(TN\) is the number of wafer defects of other defect types being classified to other defect types, and \(FN\) is the number of wafer defects of one defect type being classified to other defect types. Table 2 shows the classification results of our proposed method and two comparative methods with precision, recall, and f1-score and their corresponding macroaveraged values (i.e., arithmetic means). The highest value for each category under each evaluation indicator is bolded. The results of our proposed method for eight defect types (without \"none\") and nine defect types (with \"none\") are both presented in Table 2. For nine defect types, our method macroaveraged outperformed ICCAD'21 with 12.3% and 5.4% improvement on precision and recall rate and a 9.2% rise on f1-score. Moreover, it outperformed DAC'20 with a macroaveraged precision, recall, and f1-score of 21.1%, 20.0%, and 22.4%, respectively. There are two differences between our method and ICCAD'21. ICCAD'21 proposed a shared backbone of self-supervised and few-shot learning and united the two learners in one period [38]. We proposed to perform self-supervised learning and few-shot learning in two periods; contrastive learning was applied in the pretraining period, and then few-shot learning was embedded into the fine-tuning period. The second difference is the contrastive learning method. We used the momentum contrastive learning for self-supervised learning. The results indicate that performing self-supervised and few-shot learning in two steps benefits the classification. Furthermore, momentum contrastive learning is a more effective self-supervised learning method for WBMs. Moreover, our proposed method for fine-tuning with eight defect types outperformed fine-tuning with nine defect types in the area of eight defects macroaverage recall and f1-score. These results illustrate that removing the \"none\" type in the fine-tuning period benefits the classification of specific defects.