## 2 Methodology
### Corrosion Detection Network  
The Transformer architecture has been initially used mainly in natural language processing tasks. Vision Transformer (ViT) [41] was the first to apply the Transformer to image recognition tasks. Existing research has shown that ViT has an advantage in handling contextual semantic information. While ViT underperforms CNN when dealing with smaller datasets, its performance surpasses CNN when the dataset size is significantly larger.  
Recently, many hybrid architectures that combine ViT and CNN have been proposed, showing better performance than pure CNN networks. Examples include MobileViT (MobileViTv1) [42], MobileViTv2 [43], MobileViTv3 [44], MobileFormer [45], and CoAtNet [46]. Although MobileViTv1 combines CNN and ViT, it has a complex learning task and is not easily scalable due to the internal fusion blocks. MobileViTv2 replaces the fusion blocks with linear complexity transformers. MobileViTv3 introduces a simple and efficient fusion block, added to MobileViTv2, addressing scaling and simplifying the learning task. As shown in Figure 2(a), there is a comparison between MobileViTv1 and MobileViTv3, while Figure 2(b) compares MobileViTv2 and MobileViTv3.  
In this study, the YOLOv10-vit model was constructed by replacing the Cross Stage Partial networks (CSP) with Focus and FPN (C2f) module in the 8 th layer of YOLOv10-N's backbone with MobileViTv3 blocks. Prior to this, multiple experiments were conducted where the C2f module in the 4 th, 8 th, and 10 th layers of YOLOv10-N's backbone was individually replaced with MobileViTv3 blocks. The accuracy and frame rate (FPS) of these experimental models are summarized in Table 2.  
The results showed that using MobileViTv3 blocks in the 8 th layer achieved the highest accuracy while satisfying real-time performance requirements. Replacing the C2f module in the 4 th layer significantly increased training costs. When used in the 6 th layer, the mAP50 was comparable to the 8 th layer, but the latter achieved a higher FPS. Additionally, since the feature map size is smaller in the 8 th layer, the computational cost is lower. Conversely, replacing the C2f module in the 10 th layer yielded suboptimal results, likely due to the reduced spatial resolution of feature maps in deeper layers, which limited the ability of MobileViTv3 blocks to effectively capture spatial features.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Version**} & **YOLOv10** & **YOLOv10** & **YOLOv10** & **YOLOv10** & **YOLOv10** & **YOLOv10** & **YOLOv10** \\  & **-N** & **-S** & **-M** & **-B** & **-L** & **-X** \\ \hline Depth & 0.33 & 0.33 & 0.67 & 0.67 & 1 & 1 \\ Width & 0.25 & 0.50 & 0.75 & 1 & 1 & 1.25 \\ FLOPs (G) & 6.7 & 21.6 & 59.1 & 92.0 & 120.3 & 160.4 \\ Latency (ms) & 1.84 & 2.49 & 4.74 & 5.74 & 7.28 & 10.70 \\ AP\({}^{\text{val}}\) (\%) & 38.5 & 46.3 & 51.1 & 52.5 & 53.2 & 54.4 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance comparison of different YOLOv10 versions [40].  
This table summarizes the performance of YOLOv10-N with MobileViTv3 blocks placed in different layers, demonstrating that replacing the C2f module in the 8 th layer achieves the best trade-off between accuracy and efficiency.