# Efficient Metal Corrosion Area Detection Model Combining Convolution and Transformer
## 3 Analysis and Discussion of Experimental Results
### Experimental Results and Analysis
#### 3.3.3 Comparison and Analysis of Performance Metrics for Different Models  
Table 4 presents the performance comparison of different models on Dataset A, including the classic U-Net [18], Hrnet [27], Deeplabv3+ [28], PSPNet [29], SegFormer [30] and Swin-U-Net [31], and the proposed MCD-Net. It can be seen that MCD-Net outperforms all other models across all performance metrics, demonstrating its advantages in the task of metal corrosion area detection. Comparison of CNN-Based models:  
U-Net, as one of the most fundamental convolutional neural network structures, shows good detail-capturing ability in corrosion detection tasks. However, its VGG16-based encoder-decoder network is limited in encoding capabilities for metal corrosion segmentation tasks. Consequently, its mIOU and F1 scores are relatively low, at 63.65% and 76.89%, respectively, with a real-time performance of 20.88 FPS. Hrnet significantly improves detail recognition by maintaining high-resolution feature extraction, achieving an mIOU of 65.91%. However, due to its limited ability to capture global features, its F1 score remains relatively low at 78.89%, with an FPS of 17.43. Deeplabv3 uses atrous convolutions to increase the receptive field, giving it an advantage in global feature extraction, achieving an mIOU of 68.12%, F1 of 80.60%, and FPS of 21.65. However, Deeplabv3's performance is limited when detecting corrosion areas in complex backgrounds, especially under noisy conditions, where it struggles with local feature extraction. Pspnet leverages a pyramid pooling module to process multi-scale features, performing well in diverse scenarios with an mIOU of 69.51%, an F1 score of 81.62%, and an FPS of 22.87. However, Pspnet lacks sufficient long-range feature capture, limiting its accuracy in certain complex scenes. In summary, traditional CNN-based models can effectively capture local details in metal corrosion detection tasks, but they struggle with global contextual information. This limitation affects detection accuracy, particularly when corrosion areas have irregular shapes, are similar to the background, or are subject to strong interference. Comparison of hybrid CNN-Transformer architectures:  
Segformer is a lightweight and efficient Transformer architecture that processes input features without positional encoding. It achieves an mIOU of 68.07%, an F1 score of 80.53%, and a real-time performance of 23.05 FPS. While Segformer has an advantage in real-time performance, it still struggles with capturing long-range dependencies in corrosion areas under complex backgrounds. Swin-U-Net, on the other hand, effectively combines local and global information through a hierarchical sliding window mechanism, achieving an mIOU of 69.74% and an F1 score of 81.69%. This demonstrates its potential in handling global features, although its fine-grained edge processing remains insufficient, with an FPS of 20.58. In comparison, the proposed MCD-Net combines convolutional neural networks with Transformer sequential encoding, retaining CNN's strengths in local feature extraction while leveraging the Transformer's self-attention mechanism to effectively capture global contextual information. In corrosion area detection, MCD-Net outperforms all other models across all metrics, achieving an mIOU of 73.55%, an F1 score of 84.53%, an mPA of 82.32%, and an mPre of 86.85%, with a real-time performance of 20.12 FPS. Although its FPS is \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Items** & **Model** & **mIOU/\%** & **F1/\%** & **mPA/\%** & **mPre/\%** & **FPS** \\ \hline
1 & U-Net [18] & 63.65 & 76.89 & 73.78 & 80.27 & 20.88 \\
2 & Hrnet [27] & 65.91 & 78.89 & 76.01 & 82.00 & 17.43 \\
3 & Deeplabv3 [28] & 68.12 & 80.60 & 77.53 & 83.93 & 21.65 \\
4 & Pspnet [29] & 69.51 & 81.62 & 78.35 & 85.17 & 22.87 \\
5 & Segformer [30] & 68.07 & 80.53 & 77.66 & 83.63 & 23.05 \\
6 & Swin-U-Net [31] & 69.74 & 81.69 & 79.69 & 83.79 & 20.58 \\
7 & MCD-Net & 73.55 & 84.53 & 82.32 & 86.85 & 20.12 \\ \hline \hline \end{tabular}
\end{table}