## 1 Introduction  
In hydraulic engineering, there are numerous metal structures such as gates, pipelines, and trash racks. These metal structures operate in complex environmental conditions during their service life and are prone to corrosion under the influence of humidity, high-velocity water flow, and alternating wet-dry cycles. Corrosion adversely affects both the functionality and strength of these structures [1]. Therefore, the timely detection of corrosion and accurate grading of its severity is crucial for ensuring the safe operation and maintenance of hydraulic engineering projects. Traditional corrosion detection methods mainly rely on manual visual inspection and corrosion grade assessment [2]. This approach is inefficient, and results may vary between inspections or across different inspectors, making the outcomes inconsistent. Moreover, the detection results are not easily visualized. With the advancement of digital imaging technology and image processing algorithms, computer-based methods such as machine vision have the potential to overcome the limitations of manual visual inspection. Currently, some studies have focused on using images to identify metal corrosion, primarily detecting corrosion by analyzing the color or feature differences between corroded and non-corroded areas [3]. Converting images to the hue saturation value (HSV) color space can enhance corrosion detection [4], but this method is still affected by the color of surface coatings. Additionally, techniques such as hybrid wavelet packet transform [5], K-means unsupervised machine learning [6], and support vector machine (SVM) supervised learning [7] have also been applied to corrosion detection. Although the algorithms developed by these researchers can detect corrosion without requiring large datasets for training, their robustness is often limited, making them less suitable for complex backgrounds in hydraulic metal structures. Moreover, they are unable to accurately determine the degree of corrosion. With the development of artificial intelligence, particularly deep learning, visual inspection using digital images has been applied to the field of corrosion detection [8; 9]. Unlike traditional methods based on color and texture features, deep learning can automatically learn high-dimensional features of corrosion, offering higher accuracy in corrosion detection and classification, as well as stronger robustness. Deep learning algorithms in corrosion image recognition tasks are mainly divided into three categories: (i) classification, (ii) object detection, and (iii) semantic segmentation. Classification algorithms mainly determine whether corrosion is present in an image, but they cannot identify the specific location of the corrosion on the metal structure. To pinpoint the exact location, the input image must be processed using the sliding window technique [10]. [PERSON] et al. [11] proposed a corrosion recognition method for ship steel structures based on a classification convolutional neural network--AlexNet. They built the corresponding corrosion dataset to train the CNN and combined the trained CNN with a sliding window technique to detect corroded areas in the images. Similarly, [PERSON] et al. [12] developed a CNN classification model for hull corrosion detection, using a sliding window for corrosion recognition and localization. [PERSON] et al. [13] constructed a dataset containing five types of defects on bridge structures and trained four CNNs--AlexNet, GoogLeNet, ResNet-50, and VGG-16--using MATLAB with transfer learning. Their experiments showed that VGG-16 had the most balanced overall performance, while AlexNet achieved the highest accuracy. [PERSON] et al. [14] proposed a ResNet-based method for detecting defects such as iron oxide discoloration, pitting, and stress corrosion cracking in nuclear fuel tanks, which helps reduce radiation exposure to personnel. [PERSON] et al.