## 4 Discussion
### Application Effects and Applicable Scenarios  
This study compared the application effects and applicable scenarios of the three integrated models, as shown in Table 3 and in the following section.  
Label classification method: The ResNeXt and Inception v3 models could name the folders and store standard/defect images, respectively; YOLO v3 used the Labellmg-master software to label the classification and location of defects.  
Building method: All three models conducted model training and testing via a Jupyter notebook. The structures of the integrated classification model and defect detection model required the training of two models respectively, thus the building time was longer and the process was more complicated.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & & & & \multicolumn{6}{c}{**Prediction Results**} \\ \cline{3-10}  & & & \multicolumn{2}{c}{**Defect Features Exist**} & \multicolumn{2}{c}{
\begin{tabular}{c} **Defect Features** \\ **Does Not Exist** \\ \end{tabular} } \\ \hline \multirow{3}{*}{Actual Performance} & \multicolumn{2}{c}{Defect Features Exist} & \multicolumn{2}{c}{True Positive (_TP_)} & \multicolumn{2}{c}{False Negative (_FN_)} \\ \cline{2-10}  & \multicolumn{2}{c}{Defect Features Does Not Exist} & \multicolumn{2}{c}{False Positive (_FP_)} & \multicolumn{2}{c}{True Negative (_TN_)} \\ \hline \hline \end{tabular}
\end{table}
Table 1: Confusion matrix.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & & \multicolumn{6}{c}{**Predictions**} \\ \cline{3-10}  & & \multicolumn{2}{c}{**ResNeXt+YOLO v3**} & \multicolumn{2}{c}{**Inception v3+YOLO v3**} & \multicolumn{2}{c}{**YOLO v3**} \\ \cline{3-10}  & & **Contaminations** & **Scratches** & **Inmanulate** & **Contaminations** & **Scratches** & **Inmanulate** & **Contaminations** & **Scratches** & **Inmanulate** & **Contaminations** & **Scratches** & 95 & 1 & 2 & 95 & 1 & 2 \\  & & & 98 & 0 & 0 & 96 & 2 & 0 & 98 & 0 \\  & & & 0 & 200 & 1 & 0 & 199 & 8 & 4 & 188 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Confusion matrix of the testing results.  
Prediction process: The integrated classification model was faster than the defect detection model. When the two-stage integrated model examined the images, it first classified the standard images and defect images, but only the defect images needed to go through the defect detection of YOLO v3. Therefore, the two-stage integrated model needed a shorter time to make the predictions.  
Applicable scenarios: The three integrated models were suitable for examining different images. The sample images used by this research had random locations and multiple forms. The experiment results showed that the YOLO v3 defect detection model often overlooked defects along the edges of the images and often misjudged the images lying between standard and defect. The Inception v3 classification model also had escapes of scratches with a smaller size and multiple forms, but the ResNeXt classification model could detect the standard and defect images more accurately. Thus, the ResNeXt+YOLO v3 integrated model was more suitable for images with defects showing in the center, while the Inception v3+YOLO v3 integrated model was more suitable for images with defects showing in larger sizes, at consistent locations, and in the center. The YOLO v3 defect detection model was more suitable for images with defects showing in the center and images that clearly distinguished immaculacy from defects.