# Efficient Metal Corrosion Area Detection Model Combining Convolution and Transformer
## 1 Introduction
proposed a multi-level, end-to-end fast detection method for surface defects on steel rails, which combines the GrabCut algorithm for defect segmentation and utilizes YOLOv2 for precise localization and detection of defects, improving both the speed and accuracy of defect extraction [10]. However, models like YOLO typically draw bounding boxes around objects or areas for detection purposes. In the context of corrosion detection, it is necessary not only to locate the area accurately but also to obtain its contour information. This allows for the calculation of the area size or further operations to assess the extent of the corrosion. Therefore, corrosion area detection requires pixel-level image segmentation methods. [PERSON] et al. used the DJI Mavic 2 Enterprise Advanced (M2 EA) drone, equipped  
Figure 1: Inspection and treatment operations for artificially corroded areas inside large ship hulls: (**a**) Interior view of the large ship hull with the industrial elevating work platform and operation platform; (**b**) close-up view of manual operations; (**c**) distant view of manual operations. with a CMOS sensor with a resolution of 48 MPx, to identify corrosion phenomena on the roofs of large industrial buildings. Based on Mask R-CNN, they performed pixel-wise segmentation of the corrosion areas and provided bounding boxes for the detected region [11]. Additionally, researchers have introduced methods such as attention mechanisms, feature fusion, and multi-scale kernel convolution into convolutional neural networks (CNNs), achieving promising results. [PERSON] et al. used a multi-scale convolutional neural network model to analyze ultrasonic-guided wave signals from corroded bolts. Under stable wave signal conditions, this approach enables rapid and relatively accurate assessment of corrosion severity [12]. [PERSON] et al. improved the U-Net model by adding a residual attention module, demonstrating good performance in detecting and classifying corrosion areas compared to other digital image processing methods that rely on color distribution [13]. [PERSON] et al. proposed an improved U-shaped network, embedding feature fusion, and bottleneck attention modules, which exhibited excellent performance in rust detection and corrosion area evaluation [14]. The introduction of attention mechanisms and feature fusion has enhanced detection effectiveness to some extent. However, existing feature fusion strategies are relatively straightforward and lack the ability to dynamically adjust feature weights, resulting in suboptimal segmentation outcomes, particularly when the rust areas are similar to the background. CNN and Transformers [15] are two widely used architectures in the field of deep learning, particularly effective in image-processing tasks. CNNs excel at extracting local features from images, such as edges and textures, by stacking multiple convolutional layers to gradually capture complex image patterns. This makes them highly suitable for handling irregular shapes and subtle corrosion features on metal surfaces. In contrast, Transformers, through their self-attention mechanism, effectively capture global information in images and establish dependencies between distant features, giving them an advantage in detecting large-scale corrosion areas, shadows, or complex backgrounds. Combining CNN and Transformer architectures leverages the strengths of both, retaining the ability to extract local details while enhancing the capacity to process global information. This makes the hybrid architecture particularly well-suited for addressing diverse and complex corrosion environments. [PERSON] et al., building on the latest Vision Transformer (ViT) architecture, mapped output sequences to corresponding image patches and used a point-wise linear decoder to obtain class labels, achieving excellent results in semantic segmentation tasks [16]. Therefore, this paper attempts to introduce the Transformer structure into CNNs to overcome the limitations of CNNs in capturing global information and long-range dependencies.