# Efficient Metal Corrosion Area Detection Model Combining Convolution and Transformer
## 3 Analysis and Discussion of Experimental Results
### Experimental Results and Analysis  
#### 3.3.1 Ablation Study  
To gain a deeper understanding of the role of each key component in the MCD-Net model, this paper conducts an analysis based on the public dataset, Dataset A, using a method of progressively adding modules to assess the contribution of each module to the overall model performance. The tested modules include the Backbone network, Transformer Encoder (Transformer), Attention-based Multi-Layer Feature Fusion (ABFF), and Score-based Multi-Scale Feature Enhancement (SMFE). Table 1 shows the comparison of performance metrics from the ablation study, with the optimal performance metrics highlighted in bold. Figure 9 presents some visualized results. All tested instances were subjected to the same level of noise, and the models were trained for the same number of epochs, with other parameters kept constant. The comparison of performance metrics between Model-1 and Model-2 in Table 1 indicates that the backbone network ResNet50 has a stronger feature extraction capability compared to VGG16, significantly improving model detection performance. Through the comparison of performance metrics for Model-3, Model-4, and Model-5, it was found that the detection performance metrics based on the SE attention mechanism are higher than those of the ABFF method, which is based on PSA [24] and CBAM [25] attention mechanisms, in the context of this study. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **Methods** & **mIOU/\%** & **F1/\%** & **mPA/\%** & **mPre/\%** \\ \hline
1 & Baseline-VGG16 & 63.65 & 76.89 & 73.78 & 80.27 \\
2 & Baseline-R50 & 68.67 & 81.03 & 78.40 & 83.85 \\
3 & R50 + ABFF-CBAM & 68.74 & 80.92 & 78.48 & 83.52 \\
4 & R50 + ABFF-PSA & 69.09 & 81.16 & 78.52 & 83.98 \\
5 & R50 + ABFF-SE & 69.18 & 81.30 & 78.89 & 83.86 \\
6 & R50 + SMFE & 71.30 & 82.83 & 80.11 & 85.75 \\
7 & R50 + Transformer & 72.40 & 83.57 & 82.03 & 85.18 \\
8 & R50 + ABFF +SMFE + Transformer & 73.55 & 84.53 & 82.32 & 86.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Module ablation experiment performance comparison. By comparing the performance metrics of Model-5, Model-6, and Model-7, it is found that among the three individual modules tested, the SR module achieved the highest mPre score, while the TE module obtained the best scores for all other metrics except mPre. The comparison between Model-2 and Model-8 shows that the combination of these modules results in a comprehensive improvement in the performance of the model for the metal corrosion detection task. Based on the performance metrics and visual comparison analysis, the introduction of the Transformer encoder shows a significant improvement in corrosion area segmentation. The Transformer encoder, leveraging the self-attention mechanism, enhances the model's ability to capture global information, providing strong encoding capabilities for identifying randomly growing and unevenly distributed corrosion areas. The attention-based multi-layer feature fusion method improves feature transmission; the attention mechanism dynamically adjusts the weights of different channels during feature fusion, suppressing irrelevant or noisy channels and reducing interference from unrelated information. This is particularly beneficial at the boundaries of corrosion areas, allowing for more precise discrimination and addressing poor segmentation caused by factors such as shadows, defects, or background similarity. The score-based feature enhancement method effectively enhances salient features, and the use of multi-scale convolution kernels improves the recognition of small corrosion areas while maintaining sensitivity to large-scale corrosion. To analyze the effectiveness of the Score-based Multi-Scale Feature Enhancement (SMFE) method, we compared Model-2 and Model-6, as mentioned before. Model-6 incorporates the proposed SMFE method, whereas Model-2 does not.