## 4 Experiments and Discussion
### Dataset Description and Implementation Details  
The dataset used in our experiment is composed of TILDA Textile Texture [33], Patterned Fabric [34; 35] and MVTec Anomaly Detection [36]. The first contains six kinds of texture images, with 50 defect-free images in each category. The second includes three kinds of texture pattern--namely box, dot, and star--each with 25 to 30 defect-free samples and defective samples which can be utilized as training dataset and testing dataset respectively. The last contains over 5000 high-resolution images divided into fifteen different object and texture categories, each with a set of defect-free training images and a test set of images with various kinds of defects. We totally selected ten kinds of texture background and constructed ten datasets accordingly, where four from the first (c1, c2, c3 and c5), there from the second (box, dot and star) and three from the last (leather, tile and wood).  
As described in Section 3.2, the proposed method is composed of four submodules: two encoders \(En_{1}\) and \(En_{2}\), one decoder \(De\), and a discriminator \(D\). The detailed parameter setup is depicted in Tables 1 and 2.  
To further evaluate the performance of the proposed method, a quantitative analysis based on the following three indicators was undertaken.  
\[Recall=\frac{TP}{TP+FP} \tag{8}\]  
\[Precision=\frac{TP}{TP+FN} \tag{9}\]  
\[F1-Measure=\frac{2\times Precision}{Precision+Recall} \tag{10}\]  
where \(TP\) represents the number of correctly detected defect pixels, \(FP\) denotes the number of falsely detected defect pixels and FN is the number of falsely detected background pixels. F1-Measure is a more convincing indicator, taking precision and recall into account. All three of these indicators are ranged [0, 1]; the higher the value, the better the performance.  
The proposed method was implemented on a desktop computer with six cores, 16 GB memory, and a GTX 1660 Nvidia GPU. The code was implemented using Python 3.7 with packages Pytorch, Numpy, and OpenCV.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Type** & **Input** & **Output** & **Kernel** & **Stride** & **Padding** \\ \hline
1 & Conv + LeakyReLU & 1 & 64 & \(4\times 4\) & 2 & 1 \\
2 & Conv + BN + & 64 & 128 & \(4\times 4\) & 2 & 1 \\
3 & Conv + BN + & 128 & 128 & \(3\times 3\) & 1 & 1 \\
4 & LeakyReLU & 128 & 256 & \(4\times 4\) & 2 & 1 \\
5 & Conv + (Sigmoid) & 256 & 100 (1) & \(4\times 4\) & 1 & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The parameter configuration of the proposed model on submodules \(En_{1}\), \(En_{2}\) and \(D\).  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Type** & **Input** & **Output** & **Kernel** & **Stride** & **Padding** \\ \hline
1 & Deconv + BN + ReLU & 100 & 256 & \(4\times 4\) & 1 & 0 \\
2 & Deconv + BN + ReLU & 256 & 128 & \(4\times 4\) & 2 & 1 \\
3 & Deconv + BN + ReLU & 128 & 128 & \(3\times 3\) & 1 & 1 \\
4 & Deconv + BN + ReLU & 128 & 64 & \(4\times 4\) & 2 & 1 \\
5 & Deconv + Tanh & 64 & 1 & \(4\times 4\) & 2 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The parameter configuration of the proposed model on submodule \(De\).