Addressing the challenge that existing deep learning models face in accurately segmenting metal corrosion boundaries and small corrosion areas. In this paper, a SegFormer metal corrosion detection method based on parallel extraction of edge features is proposed. Firstly, to solve the boundary ambiguity problem of metal corrosion images, an edge-feature extraction module (EEM) is introduced to construct a spatial branch of the network to assist the model in extracting shallow details and edge information from the images. Secondly, to mitigate the loss of target feature information during the reconstruction of the decoder, this paper adopts the gradual upsampling decoding layer design. It introduces the feature fusion module (FFM) to achieve hierarchical and progressive feature fusion, thereby enhancing the detection of small corroded areas. Experimental results show that the proposed method outperforms other semantic segmentation models achieving an accuracy of 86.56% on the public metal surface corrosion image dataset and reaching a mean intersection over union (mIoU) of 91.41% on the BSData defect dataset. On the Self-built tubing corrosion pit image dataset, the model utilizes only 3.60 MB of parameters to achieve an accuracy of 96.52%, confirming the effectiveness and performance advantages of the proposed method in practical applications.