# Efficient Metal Corrosion Area Detection Model Combining Convolution and Transformer
## 3 Analysis and Discussion of Experimental Results
### Experimental Results and Analysis
#### 3.3.2 Robustness Testing  
To verify the robustness of MCD-Net under conditions of noise and brightness variation, we conducted additional sensitivity tests based on Dataset A, aiming to simulate  
Figure 11: mIOU (a), training loss (b) curves of MCD-Net ablation study on the Dataset A.  
Figure 10: Visualization of feature activation maps for different corrosion detection categories using Grad-CAM. more complex real-world application scenarios. These operations included adding salt-and-pepper noise, Gaussian noise, and adjusting brightness (the transformation formulas are shown in (16), (17), and (18), respectively) to simulate detection conditions under extreme lighting conditions and noise caused by factors such as signal transmission. The operation for adding salt-and-pepper noise is shown in Equation (16), where parameters \(P_{salt}\) and \(P_{pepper}\) represent the probabilities of \"salt\" noise (white pixels) and \"pepper\" noise (black pixels), respectively. This type of noise randomly sets certain pixel values in the image to black or white to simulate potential interference during data transmission. \[I_{\text{noisy}}(x,y)=\left\{ \begin{array}{cl}0,&\text{with probability }p_{\text{perper}}\\ 255,&\text{with probability }p_{\text{salt}}\\ I_{\text{original}}(x,y),&\text{otherwise}\end{array} \right. \tag{16}\]  
The operation for adding Gaussian noise is described in Equation (17), where \(N\left(\mu,\theta^{2}\right)\) represents Gaussian noise that follows a normal distribution with mean \(\mu\) and variance \(\theta\). The parameter \(\mu\) relates to the average intensity of the noise, while \(\theta\) determines the noise amplitude. \[I_{\text{noisy}}=I_{\text{original}}+N\left(\mu,\theta^{2}\right) \tag{17}\]  
The brightness adjustment operation is shown in Equation (18), where \(f\) is the brightness factor. When \(f>1\), the brightness is increased; when \(f<1\), the brightness is decreased. \[I_{\text{output}}=I_{\text{input}}\times f \tag{18}\]  
Here, we select Model-2 and Model-8, as mentioned in Section 3.3.1 \"Ablation Study\" for comparison. The comparison results are shown in Tables 2 and 3, with mIOU and F1 selected as the comprehensive evaluation metrics. Compared to Model-2, Model-8 incorporates the methods applied in this paper: ABFF, SMFE, and Transformer. Overall, the proposed method, Model-8, i.e., MCD-Net, demonstrates superior noise resistance and robustness. In the absence of noise, Model-2 achieved an mIOU of 68.67% and an F1 score of 81.03%. When salt noise was added (salt noise ratio \(P_{salt}\) = 0.001, \(P_{pepper}\) = 0), the mIOU and F1 dropped to 67.02% and 79.67%, respectively, representing decreases of 1.65% and 1.36% compared to the noise-free condition. With the addition of both salt and pepper noise (\(P_{salt}\) = 0.001, \(P_{pepper}\) = 0.001), the performance dropped more significantly, with the mIOU decreasing by 4.90% and the F1 score dropping by 3.76%. MCD-Net achieved an mIOU of 73.55% and an F1 score of 84.53% under noise-free conditions. When salt-and-pepper noise was introduced, both mIOU and F1 decreased. For example, with \(P_{salt}\) = 0.001 and \(P_{pepper}\) = 0.001, the mIOU dropped from 73.55% to 70.53%, a decrease of 3.02%, while the F1 score dropped by 2.04%. While both models experienced performance degradation after adding noise, their overall performance remained satisfactory. Notably, MCD-Net demonstrated stronger noise resistance, with a relatively smaller decrease in performance.