## 3 Experiments and Results
### Performance of U-Net Segmentation and HSV Color Space Extraction  
We selected approximately 80 images containing the red light from the 6 min TURP surgery as the training datasets. During the network training, the parameters were set as follows: the batch size was set to 5 epochs, the number of steps per epoch was 200, the learning rate was 0.0001, and the loss function selected binary cross entropy. To quantitatively evaluate the presented model, the intersection over union (IOU) and dice coefficient (DC) were used as the performance metrics [50]. The IOU and DC are the most commonly used metrics in semantic segmentation. The segmentation results were compared with the ground truth (GT). Their definitions are provided in (5) and (6). \[\text{IOU}=\frac{\textit{Predict}\ \cap\ \textit{GT}}{\textit{Predict}\ \cup\ \textit{GT}} \tag{5}\]  
\[\text{Dice Coefficient}=2*\frac{|\textit{Predict}\ \cap\ \textit{GT}|}{|\textit{Predict}|+| \textit{GT}|} \tag{6}\]  
IOU is an essential method to quantify the overlap percentage of the GT and prediction output. It measures the number of common pixels between the target and prediction image. The validation samples are used to verify the performance of the U-Net segmentation model. Table 7 shows the performance of training for the U-Net segmentation model. The images with the red, green, and yellow color areas represent the GT, prediction area, and overlap between the prediction and GT, respectively. We found that the prediction images almost enclosed the GT and obtained a 0.66 average IOU score, as indicated in Figure 11b. In addition, the results of GT and the prediction images in Table 7 revealed that the prediction area almost covered the GT area. This means that the GT area of the red light, by \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Accuracy (\%)** & **Sensitivity (\%)** & **Specificity (\%)** \\ \hline Testing & & & \\ TURP surgery datasets & 97 & 98 & 94 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Results of classification. Figure 10: The images of false classification in the confusion matrix of Table 4. (**a1,a2**) Examples of FN images. (**b1,b2**) Examples of FP images. We obtained an average residual rate of 0.06, as indicated in Figure 11c, which could be capable of filtering the red light area emitted from the cutting loop using the U-Net model. Moreover, DC is another common metric used to measure the similarity of two samples--in this case, the average DC was 0.78, as indicated in Figure 11a. The performance testing of the U-Net model, integrated with the HSV color space method on the bleeding area detection, was conducted here. The experimental results in Table 8 demonstrate the performance of segmenting the red light image using the U-Net model. The overview of the images in Table 8 (1)-(10) presented better segmentation performance, that is, the red light pattern was almost extracting even near the boundary of the prostate image. Furthermore, the training performance of the U-Net model was evaluated using the loss function and training accuracy. The results are shown in Figure 12, which are both convergent to the best of fit line. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Index** & **Testing Images** & **Extraction Area** & **Segmentation** \\ \hline
1 & & & \\
2 & & & \\
3 & & & \\
4 & & & \\
5 & & & \\
6 & & & \\
7 & & & \\
8 & & & \\
9 & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Performance of segmenting the red light image using U-Net model. Finally, the comparison of the bleeding area detection using the HSV color space under the conditions, with and without using U-Net, was investigated. The experimental results in Table 9 show that the extraction effects of the HSV color space analysis method are apparently influenced by the occurrence of the red color. The red light in the bleeding area could not be completely removed by directly using the HSV color space analysis method. These results will lead to a decrease in the classification accuracy of blood loss.