# Color Structured Light Stripe Edge Detection Method Based on Generative Adversarial Networks
## 4 Experimental Results and Discussion
### Segmentation Performance Evaluation of the Proposed Network  
After the model is trained, test images are used to evaluate the semantic segmentation performance of the model. Note that these images are all cropped to the size of 1792 \(\times\) 2560 pixels for ease of evaluation. Similar to the training process, the test images are also sequentially cut into small patches. Therefore, the goal of the proposed model is to individually segment each image patch. To evaluate the reliability of the model, we used two indicators, Precision (Pre) and Recall (Re), as the evaluation metrics:  
\[\text{Pre}=\frac{TP}{TP+FP}, \tag{1}\]  
\[\text{Re}=\frac{TP}{TP+FN}, \tag{2}\]  
where true positive (_TP_) and true negative (_TN_) indicate the pixels properly classified as line and background, respectively, whereas the false positive (_FP_) and false negative (_FN_) denote misclassified pixels--background predicted as line and line predicted as background, respectively. Table 1 shows the semantic segmentation performance of the proposed model with each test image.  
It can be seen in Table 1 that the proposed method worked very well with objects with a fairly homogeneous surface (wave metal sheet, porcelain dish, and open book). However, there are still a few patches with lines unsegmented or falsely segmented in images of the objects with a multi-colored textured surface. After the image patches are predicted with the proposed model, they are merged together into large images. Finally, a morphological skeletonization algorithm is performed to obtain the centerline images (Figure 10).  
To further evaluate the image segmentation performance of the proposed model, we compared it with four other GANs-based deep learning models, including Pix2 pix [41], Res-Unet-based GAN (RU-GAN) [42], Upsample residual channel-wise attention Generative Adversarial Networks (URCA-GAN) [25], and the proposed networks without attention  
\begin{table}
\begin{tabular}{c c c c c c c} \hline
**Object** & **TP** & **FP** & **FN** & **TN** & **Pre (\%)** & **Re (\%)** \\ \hline Colored textured plastic box & 410,466 & 19,199 & 19,001 & 4,138,854 & 95.53 & 95.58 \\ Wave metal sheet & 423,066 & 11,872 & 12,952 & 4,139,630 & 97.27 & 97.03 \\ Porcelain dish & 411,728 & 12,032 & 11,153 & 4,152,607 & 97.16 & 97.36 \\ Colored textured carton box & 388,841 & 20,373 & 28,854 & 4,149,452 & 95.02 & 93.09 \\ Open book & 421,753 & 11,370 & 9447 & 4,144,950 & 97.37 & 97.81 \\ \hline \end{tabular}
\end{table}
Table 1: Segmentation performance of our network with different materials (Unit: Pixels).  
gates (Proposed w/o AG). In addition to the above two metrics, two more metrics, including Accuracy (Acc) and the F1 score, are defined in Equations (3) and (4).  
\[\text{Acc}=\frac{TP+TN}{TP+FP+TN+FN}, \tag{3}\]  
\[\text{F1}=\frac{2*TP}{2*TP+FP+FN}\, \tag{4}\]  
In this experiment, we used an image representing the images in the test set, which was an image of a paper box with a complex color pattern. The comparison of the image segmentation performance of the above networks is presented in Table 2. The segmentation  
Figure 10: Segmentation results with the proposed method: (**a**) original test image; (**b**) predicted image; (**c**) centerline image.  
results of the image of a colored textured carton box with these methods are shown in Figure 11.  
As can be seen in Figure 11 and Table 2, by replacing plain neural blocks with residual blocks, RU-GAN achieved higher accuracy than Pix2 pix. URCA-GAN achieved better segmentation results; there were only a few areas where the texture, which was similar to the color stripes, was wrongly segmented. Although the proposed method without attention gates achieved better segmentation performance than the previous methods, there were still some broken lines and a few wrongly detected regions. Meanwhile, the proposed networks can address most of these issues, thus achieving the highest segmentation performance.