Oil spills can cause damage to the marine environment. When an oil spill occurs in the sea, it is critical to rapidly detect and respond to it. Because of their convenience and low cost, navigational radar images are commonly employed in oil spill detection. However, they are currently only used to assess whether or not there are oil spills, and the area affected is calculated with less accuracy. The main reason for this is that there have been very few studies on how to retrieve oil spill locations. Given the above problems, this article introduces a model of image segmentation based on the soft attention mechanism. First, the semantic segmentation model was established to fully integrate multi-scale features. It takes the target detection model based on the feature pyramid network as the backbone model, including high-level semantic information and low-level location information. The channel attention method was then used for each of the feature layers of the model to calculate the weight relationship between channels to boost the model’s expressive ability for extracting oil spill features.Simultaneously, a multi-task loss function was used. Finally, the public dataset of oil spills on the sea surface was used for detection. The experimental results show that the proposed method improves the segmentation accuracy of the oil spill region. At the same time, compared with segmentation models, such as PSPNet, DeepLab V3+, and Attention U-net, the segmentation accuracy based on the pixel level improved to 95.77%, and the categorical pixel accuracy increased to 96.45%.