## 4 Experimental Results
### Accuracy Analysis for Classifying Normal and Defect Images
The classification method is similar to the patch image classification. If a complete image includes a patch image classified as a defect image, the complete image is a defect image. Here, we ignore the analysis of classifying normal images for the nanofiber dataset because there is only one normal image in the dataset. It is obvious that integrating the DEC loss function can make the classification of normal images maintain a high classification accuracy, while the classification accuracy of the defective image is greatly improved as a whole. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Nanofiber** & \\ \hline  & **Good** & **Defect** \\ \hline SAE & - & 95\% \\ \hline SAE + DEC & - & 100\% \\ \hline IAE & - & 100\% \\ \hline IAE + DEC & - & 100\% \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Classification accuracy for complete nanofiber images. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Good** & **Color** & **Cut** & **Hole** & **Metal** & **Thread** \\ \hline SAE & 100\% & 42.10\% & 100\% & 94.11\% & 100\% & 89.47\% \\ \hline SAE + DEC & 89.29\% & 94.73\% & 100\% & 100\% & 100\% & 100\% \\ \hline IAE & 96.50\% & 42.10\% & 100\% & 100\% & 100\% & 78.94\% \\ \hline IAE + DEC & 96.50\% & 94.73\% & 100\% & 100\% & 100\% & 100\% \\ \hline \hline \end{tabular}
\end{table} 
Table 12: Classification accuracy for complete carpet images. Figure 23: The ROC curves of patch image simulation for (**a**) nanofiber, (**b**) carpet, and (**c**) grid datasets. Figure 24 shows the ROC curves of the four models on the complete image of the carpet and grid datasets. This experiment also uses different classification thresholds to compare with the fourth Otsu threshold. In Figure 24a, the ROC curves show that classification accuracy of integrating DEC loss function is higher than others without integrating the DEC loss function. In Figure 24b, the AUC values of the four models in the grid image test are all greater than 99% because the texture pattern is regular. Using the multi-thresholding method to determine whether the image is a defect image can avoid misjudgments caused by weak defective areas. For example, Figures 25c and 26c show that there are quite large differences in the grayscale distribution on the difference images shown in Figures 25a and 26a, but the classification results are correct, shown in Figures 25b and 26b. The reason is that the multi-thresholding method calculates the fourth threshold according to the image difference distribution. Therefore, even if the image difference is not obvious, the defect area can be detected. It is difficult to obtain the correct detection result by manually setting the threshold. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Grid**} \\ \hline  & **Good** & **Bent** & **Broken** & **Glue** & **Metal** & **Thread** \\ \hline SAE & 95.30\% & 100\% & 100\% & 90.90\% & 100\% & 100\% \\ \hline SAE + DEC & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ \hline IAE & 100\% & 100\% & 100\% & 72.72\% & 100\% & 100\% \\ \hline IAE + DEC & 100\% & 100\% & 100\% & 90.90\% & 100\% & 100\% \\ \hline \hline \end{tabular}
\end{table} 
Table 13: Classification accuracy for complete grid images. Figure 24: The ROC curves of complete image simulation for (**a**) carpet and (**b**) grid datasets. Figure 25: Analysis of using multi-thresholding to identify the obvious defect carpet image. (**a**) Obvious difference image. (**b**) Apply Otsu multi-thresholding method to detect the defective area. (**c**) The result of multi-thresholding.