# TTH-Net: Two-Stage Transformer-CNN Hybrid Network for Leaf Vein Segmentation
## 4 Experiment
### Comparisons with the State of the Art
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Model** & **Year** & **Dice** & **Spe** & **Sen** & **Acc** \\ \hline \multirow{5}{*}{CNN} & FCN [10] & 2015 & 76.52 \(\pm\) 1.29 & 77.57 \(\pm\) 2.52 & 81.54 \(\pm\) 2.63 & 83.78 \(\pm\) 0.05 \\  & U-Net [12] & 2015 & 81.47 \(\pm\) 1.27 & 81.38 \(\pm\) 2.45 & 84.28 \(\pm\) 2.57 & 87.02 \(\pm\) 0.03 \\  & GhostNet [13] & 2020 & 81.22 \(\pm\) 1.35 & 80.87 \(\pm\) 2.68 & 84.33 \(\pm\) 2.66 & 86.74 \(\pm\) 0.06 \\  & MobileNetv3 [41] & 2019 & 81.34 \(\pm\) 1.38 & 80.75 \(\pm\) 2.60 & 84.36 \(\pm\) 2.72 & 86.73 \(\pm\) 0.07 \\  & DeepLabv3+ [42] & 2018 & 82.51 \(\pm\) 1.25 & 81.90 \(\pm\) 2.41 & 85.06 \(\pm\) 2.51 & 87.12 \(\pm\) 0.03 \\ \hline \multirow{5}{*}{Transformer} & ViT [15] & 2020 & 82.86 \(\pm\) 2.42 & 81.41 \(\pm\) 3.21 & 86.30 \(\pm\) 3.84 & 87.24 \(\pm\) 0.04 \\  & Segmenter [16] & 2021 & 81.71 \(\pm\) 2.37 & 80.77 \(\pm\) 3.02 & 84.88 \(\pm\) 3.91 & 87.15 \(\pm\) 0.05 \\  & Swin & & & & & \\  & Transformer [43] & 2021 & 83.14 \(\pm\) 2.44 & 81.76 \(\pm\) 3.86 & 86.75 \(\pm\) 3.72 & 87.86 \(\pm\) 0.03 \\  & SETR [17] & 2021 & 82.82 \(\pm\) 2.41 & 81.48 \(\pm\) 3.72 & 86.69 \(\pm\) 3.88 & 87.59 \(\pm\) 0.04 \\  & DeiT [44] & 2021 & 82.78 \(\pm\) 2.48 & 81.98 \(\pm\) 3.84 & 86.67 \(\pm\) 3.90 & 87.81 \(\pm\) 0.03 \\ \hline \multirow{5}{*}{Two-stage} & ALSNet [45] & 2020 & 82.36 \(\pm\) 1.23 & 81.64 \(\pm\) 2.56 & 85.58 \(\pm\) 2.59 & 87.44 \(\pm\) 0.03 \\  & TSUNet [46] & 2020 & 82.93 \(\pm\) 1.25 & 81.53 \(\pm\) 2.72 & 85.72 \(\pm\) 2.47 & 87.63 \(\pm\) 0.02 \\  & DDNet [47] & 2021 & 83.89 \(\pm\) 1.31 & 82.45 \(\pm\) 2.64 & 86.85 \(\pm\) 2.53 & 87.82 \(\pm\) 0.01 \\  & APCNet [48] & 2020 & 83.40 \(\pm\) 1.40 & 81.55 \(\pm\) 2.51 & 86.77 \(\pm\) 2.58 & 87.47 \(\pm\) 0.03 \\  & CMMANet [49] & 2023 & 83.96 \(\pm\) 1.29 & 82.03 \(\pm\) 2.43 & 86.89 \(\pm\) 2.61 & 87.62 \(\pm\) 0.04 \\  & PCDNet [50] & 2022 & 83.49 \(\pm\) 1.26 & 82.16 \(\pm\) 2.49 & 86.38 \(\pm\) 2.50 & 87.53 \(\pm\) 0.02 \\  & **TTH-Net** & – & **85.24** \(\pm\) 1.28 & **82.95** \(\pm\) 2.46 & **87.36** \(\pm\) 2.55 & **89.01** \(\pm\) 0.03 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The results of the proposed TTH-Net and competitors on the LVN dataset. Note that each metric is reported via the mean (standard deviation) of 5-fold cross-validation. As shown in Figure 5, visual comparisons of the highest-scoring models for CNN, Transformer, and the two-stage algorithm are conducted, respectively. The CNN model, DeepLabv3+, exhibits relatively coarse texture detection of vein patterns, accompanied by numerous isolated pixels and some incorrectly classified curves. For the Swin Transformer, there is a more pronounced issue of misclassifying vein curve pixels as background pixels, which also results in a suboptimal performance. In contrast to our proposed TTH-Net, TTH-Net is capable of segmenting fine-grained vein textures with strong curve continuity. Additionally, the segmentation results exhibit minimal occurrence of isolated pixels. As a result, the proposed TTH-Net can segment veins accurately and achieve state-of-the-art performance for leaf vein segmentation tasks. Finally, we record the curves of loss vs. number of iterations and accuracy and vs. number of iterations during the training and validation process, as shown in Figure 6. From Figure 6a, we can find that our proposed model shows the consistency between the loss curves during training and validation process, which indicates that TTH-Net is not overfit or underfit. In Figure 6b, as the number of iterations increases, the accuracy of the TTH-Net keeps improving, and the optimal number of iterations is 50,000. Figure 5: Visual comparison between TTH-Net and other competitors on the LVN dataset for leaf vein segmentation. The red rectangular boxes and arrows are meant to highlight the advantages of TTH-Net.