## 5 Conclusions  
In this paper, we propose an unsupervised learning-based method to detect and segment defects in texture images. A novel model based on a deep convolutional generative adversarial network (DCGAN) is utilized to reconstruct the input image; the obtained residual image is utilized to predict the position of defect at a global view. An embedded local difference analysis module is presented to locate defects at the regional level, which can eliminate falsely detected areas. Finally, the pixel-level and regional-level predictions are synthesized to obtain the final result. A series of comparative experiments were conducted and confirmed that the proposed method is effective and has a wide range of applications.  
Our method showed superior performance with a wide range of texture surfaces. Yet, there are still difficulties in detecting some confusing defects which have a high degree of similarity with texture background in appearance. In the future, we would like to explore some machine learning-based strategies to improve the distinctiveness between foreground and background areas.  
Conceptualization, J.W. and Y.W.; methodology, J.W., G.Y. and S.Z.; validation, J.W. and Y.W.; formal analysis, J.W., [PERSON], S.Z. and Y.W.; writing--original draft preparation, [PERSON], G.Y. and S.Z.; writing--review and editing, [PERSON], G.Y. and S.Z. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the National Natural Science Foundation of China, grant number 51875515 and the Science and Technology Program of Beijing, grant number Z191100001419014.  
**Institutional Review Board Statement:** No applicable.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Method** & **Recall** & **Precision** & **F1-Measure** \\ \hline \multirow{4}{*}{(a)} & PHOT & **0.9064** & 0.0638 & 0.1192 \\  & AnoGAN & 0.4101 & 0.1667 & 0.2370 \\  & MS-CDAE & 0.4892 & 0.0612 & 0.1088 \\  & Ours & 0.3165 & **0.4400** & **0.3682** \\ \hline \multirow{4}{*}{(b)} & PHOT & 0.6795 & 0.4976 & 0.5745 \\  & AnoGAN & **0.7372** & 0.6383 & 0.6842 \\  & MS-CDAE & 0.4815 & **0.8101** & 0.6040 \\  & Ours & 0.6410 & 0.7829 & **0.7049** \\ \hline \multirow{4}{*}{(c)} & PHOT & **0.7500** & 0.3802 & 0.5046 \\  & AnoGAN & 0.5427 & **0.9271** & 0.6846 \\ \cline{1-1}  & MS-CDAE & 0.6474 & 0.7953 & 0.7137 \\ \cline{1-1}  & Ours & 0.6402 & 0.8445 & **0.7283** \\ \hline \hline \end{tabular}
\end{table}
Table 6: Quantitative comparative results of Figure 9a–c between different methods.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Method** & **Recall** & **Precision** & **F1-Measure** \\ \hline \multirow{4}{*}{(a)} & PHOT & 0.2354 & 0.1639 & 0.1933 \\  & AnoGAN & **0.6398** & 0.6398 & 0.6398 \\  & MS-CDAE & 0.5081 & 0.8638 & **0.6398** \\  & Ours & 0.4068 & **0.9747** & 0.5741 \\ \hline \multirow{4}{*}{(b)} & PHOT & **0.7651** & 0.1742 & 0.2838 \\  & AnoGAN & 0.0996 & 0.0727 & 0.0841 \\  & MS-CDAE & 0.0196 & 0.0840 & 0.0317 \\  & Ours & 0.3843 & **0.2935** & **0.3328** \\ \hline \multirow{4}{*}{(c)} & PHOT & **0.9109** & 0.3054 & 0.4574 \\  & AnoGAN & 0.2888 & 0.1482 & 0.1959 \\ \cline{1-1}  & MS-CDAE & 0.1595 & 0.3763 & 0.2240 \\ \cline{1-1}  & Ours & 0.4440 & **0.6464** & **0.5264** \\ \hline \hline \end{tabular}
\end{table}
Table 5: Quantitative comparative results of Figure 8a–c between different methods.