A sea surface oil spill detection method based on improved deeplabv3+

CN117372884BActive Publication Date: 2026-08-21NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311202507.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2026-08-21
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

[0005]本发明的目的在于解决少数边缘模糊、形状高度复杂等困难样本的识别问题,提供一种基于改进Deeplabv3+的海面溢油暗斑检测方法,用于提高溢油检测模型的识别精度,降低虚警率

Benefits of technology

[0020]本发明具有积极的效果:1)本发明对海面溢油检测模型训练时采用由BCE损失函数、Focal损失函数和SSIM损失函数共同构成的联合损失函数,BCE损失函数计算真实结果和预测结果之间的整体相似性来确保预测结果整体结构的精准性,Focal损失函数用α来平衡正、负样本的权重,用γ来平衡难分样本和简单样本的权重,使用SSIM损失赋予边界更高的权值,从而鼓励尊重原始图像结构的预测。三者共同作用,提高了溢油检测模型的识别精度,实现了精准识别具有模糊和边界高度复杂的SAR图像;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117372884B_ABST
    Figure CN117372884B_ABST
Patent Text Reader

Abstract

The application discloses a sea surface oil spill detection method based on an improved Deeplabv3+, and is mainly applied to the field of marine environmental protection and monitoring. In view of the fact that existing deep learning-based methods do not design networks for extremely irregular oil spill dark spots, a new semantic segmentation algorithm based on the improved Deeplabv3+ is proposed to solve the problems of poor segmentation effect of the oil spill target with fuzzy boundary and the like, and comprises the following steps: oil spill image collection and storage, image preprocessing, oil spill dataset construction, Deeplabv3+ model construction, network model improvement, oil spill dark spot detection model training and testing. Experiments show that the method can accurately identify difficult samples, improve the recognition accuracy of the oil spill detection model and reduce the false alarm rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of marine oil spill target detection technology, and in particular to a method for detecting marine oil spills based on an improved Deeplabv3+. Background Technology

[0002] When a ship sinks or oil wells, storage tanks, pipelines, or other oil transportation facilities rupture, burn, or explode, it severely damages both land and sea oil transportation and monitoring systems, resulting in massive oil spills and enormous economic losses. The spilled oil floats on the ocean surface and rapidly spreads, forming an oil slick. The spilled oil undergoes various migrations and transformations, such as evaporation, dissolution, emulsification, and absorption. Furthermore, it alters the original marine ecological environment and disrupts the marine ecosystem. Marine communities affected by oil spills require a complex and lengthy process to recover to normal, and oil spill pollution has a long-term and devastating impact on marine biodiversity and the evolution of marine communities.

[0003] Traditional oil spill monitoring methods primarily rely on ship monitoring and buoy tracking. However, with the continuous development of satellite remote sensing technology, it has become the most effective method. Satellite remote sensing can effectively monitor the area and spread trend of oil spills, providing crucial data support for marine departments and offering significant reference value for oil spill cleanup and marine environmental governance. Synthetic Aperture Radar (SAR), a microwave sensor, can generate high-resolution images, offering all-weather, all-day coverage. SAR can also provide information on the location and size of oil spills, making it considered one of the most powerful tools for environmental monitoring. Installing SAR on a satellite platform allows for the detection of marine oil spills in conjunction with SAR imagery, providing data support for subsequent oil spill remediation and marine environmental restoration.

[0004] Among existing marine oil spill detection equipment, infrared image-based detection devices have advantages such as all-weather adaptability and low cost. However, infrared images also have shortcomings such as low contrast, low edge sharpness, blurred edges, and severe noise interference, affecting the accuracy of oil spill detection. Deep learning methods, on the other hand, have advantages such as strong learning ability, high generalization ability, and strong adaptability. They can overcome the limitations of traditional methods in extracting oil spill areas from SAR oil spill images, and require less manual operation, exhibiting good versatility. High detection accuracy can be obtained simply by using image information as input data. Summary of the Invention

[0005] The purpose of this invention is to solve the problem of identifying a small number of difficult samples with blurred edges and highly complex shapes, and to provide a method for detecting dark spots in oil spills on the sea surface based on the improved Deeplabv3+, which can improve the recognition accuracy of the oil spill detection model and reduce the false alarm rate.

[0006] To achieve the objectives of this invention, the technical solution adopted is: a method for detecting oil spills on the sea surface based on an improved Deeplabv3+, comprising the following steps: S1. Image collection and storage: The oil spill remote sensing images acquired by synthetic aperture radar are used as raw data and transmitted via optical fiber to the server. S2. Image preprocessing: Radiometric calibration and filtering correction are performed on the remote sensing images of the oil spill. S3. Oil spill dataset construction: The oil spill remote sensing images are divided into multiple sub-images and further expanded using data augmentation. Then, open source software is used to label the samples, and finally, the dataset is divided into three parts: training set, validation set, and test set. S4, Deeplabv3+ model construction, building a Deeplabv3+ network model based on pytoch; S5. Improve the network model by introducing a self-attention mechanism to enhance the feature extraction capability of the network model, using deformable ROI pooling layers to improve the network's ability to handle complex deformations and speed up training time, and finally optimizing the loss function so that the network model can focus on adjusting the boundary parameters. S6, Oil Spill Dark Spot Detection Model Training; S7. Testing of oil spill detection model on the sea surface.

[0007] As an optimized solution of the present invention, step S1 specifically involves: acquiring C-band SAR imaging data from the Sentinel-1A satellite equipped with synthetic aperture radar as the raw data for the oil spill remote sensing image, selecting GRD imaging mode, image width of 250km, spatial resolution of 5m×20m, and polarization mode of VV.

[0008] As an optimized solution of the present invention, step S2 specifically includes: S21, Radiation calibration, through ENVI 5.3 Software Toolbox In the toolkit Radiometric Calibration The item is calibrated; S22, Filter correction, utilizing Toolbox In the toolkit Lee Filtering, with the sliding window set to 7×7.

[0009] As an optimized solution of the present invention, step S3 specifically includes: S31. Manually remove low-quality images, and then use the OpenCV method to divide the oil spill remote sensing images into multiple 256×256 sub-images; S32, Use Mosaic , Copypaste or Augment HSV Advanced data augmentation techniques improve Deeplabv3 + Model generalization performance; S32, Use labelme The open-source software marks the dark spots in the remote sensing images of the oil spill samples, generates dark spot and background areas, and divides them into three parts in a ratio of 7:2:1: training set, validation set, and test set.

[0010] As an optimized solution of the present invention, step S4 specifically involves: configuring a virtual environment and building a network model structure of Deeplabv3+, including an encoder module and a decoder module. The encoder module consists of a feature extraction network Mobilenetv2, a feature pyramid network ASPP, and a point convolutional layer. The decoder module receives the results of the main encoding branch and low-level feature mapping, builds an upsampling module after passing through the point convolutional layer, and finally completes the preliminary test.

[0011] As an optimized solution of the present invention, in step S5, the self-attention mechanism specifically involves: for each position on the output feature map, the self-attention mechanism uses... Non - Local The attention mechanism, as shown in the formula below:

[0012] in x i This is the input signal at position i, and here is the original feature map. j It is an enumeration of the indices of all possible positions. y To and x Output signals of the same magnitude f ( x i , y j ) used for calculation i and j The correlation between elements at two positions, g ( x j Let be the transformation function of x, and calculate... x exist j Position representation, C( x () represents the response factor; the specific steps are as follows: S51. Output feature map A linear mapping is performed, which compresses the feature map channels through point convolution, resulting in three identical channels. The θ, φ, and g features; where C represents the number of feature map channels, H represents the feature map height, and W represents the corresponding width; S52, Reshape operation, merges the three feature dimensions other than channels, and then performs matrix multiplication on θ and φ: θ φ yields a similar covariance matrix; S53. Normalize the autocorrelation features using the following formula: in, x i For the first i The output value of each node, where n is the number of categories. S54. Multiply the output value back into the g matrix as the corresponding Self-Attention coefficient. Then, perform Reshape and 1×1 point convolution operations to expand the number of channels to the original input feature map channels, resulting in an expanded output feature map F', where F'∈R. C×H×W ; S55. Finally, perform residual calculation between the obtained feature map F' and the original feature map F, using the following formula: Z i = W z y i + x i Among them, "+" x i "Indicates residual connection to obtain the output of the Non-Local module, W z express y i The weight matrix, y i Indicates after nonlocal operation i Location feature map, Z i This represents the final output feature map.

[0013] As an optimized solution of the present invention, the deformable ROI pooling layer in step S5 is specifically as follows: Given an input feature map x and object detection candidate boxes of size w×h, ROI Pooling divides the object detection candidate boxes into K*K regions and outputs a feature map y. For each bin, the following formula is obtained: in,( i , j ) represents the position coordinates, 0 ≤ i j < k, nij The number of pixels in a bin, y( i , j ) indicates the ( i , j Output feature map at ) bin positions, ∆p ij It is generated by branches of fully connected layers at the same level. p0 is the position of the top left corner of the input feature map x, p refers to the position of each bin, ∆p ij The formula is as follows: Where: γ is a predefined scaling factor that needs to be predicted, with a value of 1; First, a k×k feature map is obtained through ROI pooling, and then a normalized offset is obtained through a fully connected layer. Then, the width and height of the remaining input feature map are multiplied dotwise, and finally multiplied by the scaling factor γ to obtain the actual offset result.

[0014] As an optimization of the present invention, in step S5, the loss function is optimized as follows: The formula for adding Focal and SSIM loss functions to the binary cross-entropy loss is as follows: Loss = L BCE + L Focal + L SSIM in: Loss For loss function, L BCE for BCE loss function L Focal for Focal loss function L SSIM for SSIM Loss function; BCE The loss function formula is as follows: in, for x Belongs to the i The predicted probabilities of each category, y i is the truth label, which can be 0 or 1, and N is the number of samples; Focal The loss function formula is as follows:

[0015] Where α is a factor that balances the weights of positive and negative samples, typically set to 0.25. It is a factor that balances the weights of hard-to-distinguish and easy-to-distinguish samples, usually set to 2. ρ is the probability that the model predicts a sample as positive. The SSIM loss function formula is as follows:

[0016] Where, μ x μ y and σ x σ y The mean and standard deviation of x and y are respectively, and σ is the standard deviation of x and y. xy To account for its covariance, C1 and C2 are positive constants to avoid division by zero; Where K1 takes the value 0.01, K2 takes the value 0.03, and L = 255.

[0017] As an optimized solution of the present invention, step S6 specifically includes: S61. Divide the oil spill dataset constructed in step S3 into a training set, a validation set, and a test set according to a certain ratio; S62. Training experiment using the data package of the open source project MMDetection. Backbone uses Mobilenetv2, Batch size is set to 4, stochastic gradient descent algorithm is selected as the optimization algorithm, learning rate is set to 0.007, and 2100 images are trained for 50 epochs. S63. Save the models trained in each epoch and select the model with the highest accuracy as the final model.

[0018] As an optimization of the present invention, in step S7, the specific steps are as follows: the model trained in step S6 is validated on a test set. The test set contains 300 oil spill images of size 256*256, which are the same as the training set. Remote sensing images of Sentinel-1A satellite in the C-band are selected. Accuracy and average intersection-over-union ratio are used as performance indicators, and the number of image frames processed per second (FPS) is used as a speed indicator to evaluate the performance of the oil spill dark spot detection algorithm. The formula for calculating accuracy is as follows: The formula for calculating mIoU is as follows:

[0019] Among them, TP represents true positive, FP represents false positive, FN represents false negative, and TN represents true negative.

[0020] This invention has the following positive effects: 1) This invention uses a method derived from... BCE loss function Focal loss function and SSIM The joint loss function is formed by the loss functions together. BCE The loss function calculates the overall similarity between the actual and predicted results to ensure the accuracy of the overall structure of the prediction results. Focal The loss function uses α to balance the weights of positive and negative samples, and γ to balance the weights of hard-to-distinguish and easy-to-distinguish samples. SSIM The loss function assigns higher weights to the boundaries, thereby encouraging predictions that respect the original image structure. These three factors work together to improve the accuracy of the oil spill detection model, enabling precise identification of SAR images with blurred and highly complex boundaries. 2) This invention introduces Non - Local Attention module. The attention mechanism aims to teach the system to pay attention—to ignore irrelevant information and focus on key information. Its purpose is to reduce reliance on external information and make the most of the information inherent in the features for attentional interaction. Non - Local The module models the global context through a self-attention mechanism, effectively capturing long-range feature dependencies. This addresses the inefficiency caused by repeatedly processing local neighborhoods during convolutional operations, thereby improving detection accuracy.

[0021] 3) This invention introduces a deformable ROI pooling layer to replace the original pooling layer. Compared to general pooling, ROIPooling scales each region of interest from the input list to a predefined size, which can significantly speed up training and testing time. The regular grid sampling in standard convolutions is the root cause of the network's difficulty in adapting to geometric deformations. To mitigate this limitation, an offset variable is added to the position of each sampling point in the convolution kernel, allowing for arbitrary sampling near the current position without being limited to previous regular grid points. Attached Figure Description

[0022] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0023] Figure 1 This is a flowchart of the present invention; Figure 2 This is a flowchart of the present invention; Figure 3 for Non - Local Schematic diagram of the attention mechanism structure; Figure 4 This is a schematic diagram of a deformable ROI pooling layer structure; Figure 5 A schematic diagram of the optimized Deeplabv3+ model structure; Figure 6 This is a diagram showing the detection results in this invention; Figure 7 This is a comparison chart of the detection results before and after optimization. Detailed Implementation

[0024] The method of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0025] like Figure 1 As shown, this invention discloses a method for detecting dark spots in marine oil spills based on an improved Deeplabv3+, comprising the following steps: S1. Image collection and storage: The oil spill remote sensing images acquired by synthetic aperture radar are used as raw data and transmitted via optical fiber to the server. First, C-band SAR images were acquired from the Sentinel-1A satellite equipped with synthetic aperture radar as the raw data for oil spill remote sensing images. The GRD imaging mode was selected, the image width was set to 250km, the spatial resolution was 5m×20m (single-view), and the polarization mode was set to VV. The data was then downloaded and transmitted to the server for storage.

[0026] S2. Image preprocessing: Radiometric calibration and filtering correction are performed on the remote sensing images of the oil spill; specifically: S21. Radiation calibration, using ENVI 5.3 software. Toolbox In the toolkit Radiometric Calibration The item is calibrated; S22, Filter correction, utilizing Toolbox In the toolkit Lee Filtering, with the sliding window set to 7×7.

[0027] S3. Oil spill dataset construction: The oil spill remote sensing images are divided into multiple sub-images and further expanded using data augmentation. Then, open source software is used to label the samples, and finally, the dataset is divided into three parts: training set, validation set, and test set. Specifically: S31. Manually remove low-quality images, and then use the OpenCV method to divide the oil spill remote sensing images into multiple 256×256 sub-images; S32, Use Mosaic , Copypaste or Augment HSV Advanced data augmentation techniques improve Deeplabv3 + Model generalization performance; S32. Use the labelme open-source software to label the dark spots in the sample images, generate dark spot and background regions, and divide them into three parts: training set, validation set and test set in a ratio of 7:2:1.

[0028] S4 Deeplabv 3+ model building, based on PyToc Deeplabv3 +Network model; Specifically, this involves configuring a virtual environment and setting it up. Deeplabv The Deeplabv3+ network model structure consists of two parts: an encoder module and a decoder module. The encoder module is composed of a feature extraction network (Mobilenetv2), a feature pyramid network (ASPP), and point convolutions. The decoder module receives the results of the main encoder branch and low-level feature maps, passes them through point convolutional layers, and then builds an upsampling module. Finally, it performs preliminary testing. The purpose of the upsampling module is to enlarge the original image so that it can be displayed on higher-resolution devices. Deeplabv3+ uses bilinear interpolation to achieve a four-fold upsampling. In the decoder module, the first upsampling is applied to the main encoder branch results to stitch together the low-level features in the decoder; the second upsampling is applied in the final step before prediction to enlarge the feature map to the original image for prediction. Preliminary testing involves running `test.py` with a single image to check if the network is successfully built. If successful, training begins with a custom dataset to obtain the optimal network parameters for that dataset.

[0029] S5. Improve the network model by introducing a self-attention mechanism to enhance the feature extraction capability of the network model, using deformable ROI pooling layers to improve the network's ability to handle complex deformations and speed up training time, and finally optimizing the loss function so that the network model can focus on adjusting the boundary parameters.

[0030] In step S5, the self-attention mechanism specifically works as follows: for each position on the output feature map (referring to the output feature map after nonlocal operations, where nonlocal operations are weighted calculations of all positional features), the self-attention mechanism uses... Non - Local The attention mechanism, as shown in the formula below:

[0031] in i It is the index of its response output position. j It is an enumeration of the indices of all possible positions. x For input signal, y To and x Output signals of the same magnitude f ( x i , y j ) used for calculationi and j The correlation between elements at two positions, g ( x j ) calculate x exist j Position representation, C( x () represents the response factor; the specific steps are as follows: S51. Output feature map A linear mapping is performed, which compresses the feature map channels through point convolution, resulting in three identical channels. The θ, φ, and g features; where C represents the number of feature map channels, H represents the feature map height, and W represents the corresponding width; S52, Reshape operation, combines the dimensions of the above three features excluding channels, and then performs matrix multiplication on θ and φ: θ φ yields a similar covariance matrix, which in turn reveals the correlation between each pixel and other pixels (autocorrelation features). S53. Normalize the autocorrelation features using the following formula:

[0032] in, x i For the first i The output value of each node, where n is the number of categories. S54. Multiply the output value back into the g matrix as the corresponding Self-Attention coefficient. Then, perform Reshape and 1×1 point convolution operations to expand the number of channels to the original input feature map channels, obtaining F', where F'∈R. C×H×W ; S55. Finally, perform residual calculation between the obtained F' and the original feature map F, as shown in the following formula: Z i = W z y i + x i Among them, "+" x i "" indicates a residual connection to obtain the output of the Non-Local module. W z express y i The weight matrix, y i Indicates after nonlocal operation i Location feature map, Z i This represents the final output feature map.

[0033] In step S5, the deformable ROI pooling layer is as follows: Given an input feature map x and a RoI (object detection candidate box) of size w width × h height, ROI Pooling divides the detection box into k*k regions (bins) (k is a user-defined parameter) and outputs a feature map y. For each bin, the following formula can be obtained: in,( i , j ) represents the position coordinates, 0 ≤ i j < k, n ij The number of pixels in a bin, y( i , j ) indicates the ( i , j Output feature map at ) bin positions, Δp ij It is generated by branches of fully connected layers at the same level. p0 is the position of the top-left corner of the input feature map x, p refers to the position of each bin, Δp ij The formula is as follows: Where: γ is a predefined scaling coefficient that needs to be predicted, and its value is 1; First, a k×k feature map is obtained through ROI pooling, and then a normalized offset is obtained through a fully connected layer. Then, the width and height of the remaining input feature map are multiplied dotwise, and finally multiplied by the scaling factor γ to obtain the actual offset result.

[0034] In step S5, the loss function is optimized, as follows: The formula for adding Focal and SSIM loss functions to the binary cross-entropy loss is as follows: Loss = L BCE + L Focal + L SSIM in: Loss For loss function, L BCE for BCE loss function L Focal for Focal loss function L SSIM for SSIM Loss function; BCE The loss function formula is as follows:

[0035] in, For pixels i The predicted probability of oil spill objects. y i is the truth label, which can be 0 or 1, and N is the number of samples; Focal The loss function formula is as follows:

[0036] Where α is a factor that balances the weights of positive and negative samples, typically set to 0.25. It is a factor that balances the weights of hard-to-distinguish and easy-to-distinguish samples, usually set to 2. ρ is the probability that the model predicts a sample as positive. The SSIM loss function formula is as follows:

[0037] Where, μ x μ y and σ x σ y The mean and standard deviation of x and y are respectively, and σ is the standard deviation of x and y. xy To determine its covariance, C1 and C2 are set to very small positive values ​​to avoid division by zero.

[0038] Where K1 takes the value 0.01, K2 takes the value 0.03, and L = 255.

[0039] S6, Oil Spill Dark Spot Detection Model Training; S61. Divide the oil spill dataset constructed in step S3 into a training set, a validation set, and a test set according to a certain ratio; S62. Training experiment using the data package of the open source project MMDetection. Backbone uses Mobilenetv2, Batch size is set to 4, stochastic gradient descent algorithm is selected as the optimization algorithm, learning rate is set to 0.007, and 2100 images are trained for 50 epochs. S63. Save the models trained in each epoch and select the model with the highest accuracy as the final model.

[0040] S7. Testing of marine oil spill detection model; Specifically, the model trained in step S6 is validated on a test set consisting of 300 oil spill images (256*256 pixels each), identical to the training set, using remote sensing images from the Sentinel-1A satellite in the C-band; accuracy and average intersection-over-union ratio (IoU) are used. mIoU The performance of the oil spill dark spot detection algorithm is evaluated by using the number of image frames processed per second (FPS) as a performance indicator and the number of image frames processed per second (FPS) as a speed indicator. The formula for calculating accuracy is as follows:

[0041] The formula for calculating mIoU is as follows:

[0042] In this context, TP represents true positives (the number of pixels correctly predicted), FP represents false positives (the number of pixels predicted as positive but actually negative), FN represents false negatives (the number of pixels predicted as negative but actually positive), and TN represents true negatives (the number of pixels predicted as negative but actually negative).

[0043] Example 1 The method for detecting dark spots in marine oil spills based on the improved Deeplabv3+ of this invention is adopted according to... Figure 2 The design flow shown was used for the experiment. After obtaining the dataset of images taken from the Sentinel-1A satellite, they were labeled using labeling software and then randomly divided into training and validation sets. The training set contained 2100 SAR images, and the validation set contained 300 SAR images. A Deeplabv3+ network model was then built and introduced... Figure 3 , Figure 4 The module shown optimizes the network model structure, and finally obtains Figure 5 The improved network model is shown. Appropriate training parameters are selected for training, and the optimal model is used for validation. Some visualization results are provided. Figure 6 and Figure 7 .

[0044] To verify the effectiveness of the detection method, an ablation experiment was conducted, and the results are shown in Table 1: Table 1 Ablation Experiment

[0045] To compare the detection performance of different object detection algorithms, a comparative experiment was conducted, and the results are shown in Table 2: Table 2 Comparative Experiments

[0046] This paper discloses an improved Deeplabv3+-based method for detecting oil spills on the sea surface, primarily applied to marine environmental protection and monitoring. Given that existing deep learning-based methods do not specifically design networks for oil spill spots with extremely irregular shapes, and suffer from poor segmentation results for oil spill targets with blurred boundaries, and that relying solely on convolution operators to extract features from local regions fails to capture the global context of the image, this paper proposes a semantic segmentation algorithm based on improved Deeplabv3+. Furthermore, by incorporating a self-attention mechanism and improving the loss function, this method effectively addresses the identification problem of a few difficult samples with blurred edges and highly complex shapes, compensating for the inability of pure convolution operations to focus on global image information, thereby improving the recognition accuracy of the oil spill detection model and reducing the false alarm rate.

[0047] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting oil spills on the sea surface based on an improved Deeplabv3+, characterized in that: Includes the following steps: S1. Image collection and storage: The oil spill remote sensing images acquired by synthetic aperture radar are used as raw data and transmitted via optical fiber to the server. S2. Image preprocessing: Radiometric calibration and filtering correction are performed on the remote sensing images of the oil spill. S3. Oil spill dataset construction: The oil spill remote sensing images are divided into multiple sub-images and further expanded using data augmentation. Then, open source software is used to label the samples, and finally, the dataset is divided into three parts: training set, validation set, and test set. S4, Deeplabv3+ model construction: Building the Deeplabv3+ network model based on pytoch; S5. Improve the network model by introducing a self-attention mechanism to enhance the feature extraction capability of the network model, using deformable ROI pooling layers to improve the network's ability to handle complex deformations and speed up training time, and finally optimizing the loss function so that the network model can focus on adjusting the boundary parameters. S6, Oil Spill Dark Spot Detection Model Training; S7. Testing of marine oil spill detection model; In step S5, the self-attention mechanism specifically involves: for each location on the output feature map, the self-attention mechanism uses... Non - Local The attention mechanism, as shown in the formula below: in x i This is the input signal at position i, and here is the original feature map. j It is an enumeration of the indices of all possible positions. y To and x Output signals of the same magnitude f ( x i , y j ) used for calculation i and j The correlation between elements at two positions, g ( x j Let be the transformation function of x, and calculate... x exist j Position representation, C( x () represents the response factor; the specific steps are as follows: S51. Output feature map A linear mapping is performed, which compresses the feature map channels through point convolution, resulting in three identical channels. The θ, φ, and g features; where C represents the number of feature map channels, H represents the feature map height, and W represents the corresponding width; S52, Reshape operation, merges the three feature dimensions other than channels, and then performs matrix multiplication on θ and φ: θ φ yields a similar covariance matrix; S53. Normalize the autocorrelation features using the following formula: in, x i For the first i The output value of each node, where n is the number of categories. S54. Multiply the output value back into the g matrix as the corresponding Self-Attention coefficient. Then, perform Reshape and 1×1 point convolution operations to expand the number of channels to the original input feature map channels, resulting in an expanded output feature map F', where F'∈R. C×H×W ; S55. Finally, perform residual calculation between the obtained feature map F' and the original feature map F, using the following formula: Z i = W z y i + x i Among them, "+ x i "Indicates residual connection to obtain the output of the Non-Local module, W z express y i The weight matrix, y i Indicates after nonlocal operation i Location feature map, Z i This represents the final output feature map; In step S5, the deformable ROI pooling layer is specifically as follows: Given an input feature map x and object detection candidate boxes of size w×h, ROI Pooling divides the object detection candidate boxes into k*k regions and outputs a feature map y. For each bin, the following formula is obtained: in,( i , j () represents the position coordinates, 0 ≤ i, j < k, n ij The number of pixels in a bin, y( i ,j) represents the ( i Output feature maps at bin positions j, Δp ij It is generated by branches of fully connected layers at the same level. p0 is the position of the top left corner of the input feature map x, p refers to the position of each bin, and Δp ij The formula is as follows: Where: γ is a predefined scaling coefficient that needs to be predicted, and its value is 1; First, a k×k feature map is obtained through ROI pooling, and then a normalized offset is obtained through a fully connected layer. Then, the width and height of the remaining input feature map are multiplied dotwise, and finally multiplied by the scaling factor γ to obtain the actual offset result.

2. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: Step S1 specifically involves: acquiring C-band SAR imaging data from the Sentinel-1A satellite equipped with synthetic aperture radar as the raw data for the oil spill remote sensing image, selecting GRD imaging mode, image width of 250km, spatial resolution of 5m×20m, and polarization mode of VV.

3. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: Step S2, as described above, specifically includes: S21. Radiation calibration, using ENVI 5.3 software. Toolbox In the toolkit Radiometric Calibration The item is calibrated; S22, Filter correction, utilizing Toolbox In the toolkit Lee Filtering, with the sliding window set to 7×7.

4. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: Step S3 specifically includes: S31. Manually remove low-quality images, and then use the OpenCV method to divide the oil spill remote sensing images into multiple 256×256 sub-images; S32. Use advanced data augmentation techniques such as Mosaic, Copypaste, or Augment HSV to improve the generalization performance of Deeplabv3+ models; S32. Use the labelme open-source software to label the dark spots in the remote sensing image of the oil spill sample, generate dark spots and background areas, and divide them into three parts: training set, validation set and test set in a ratio of 7:2:

1.

5. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: Step S4 specifically involves: configuring a virtual environment and building the Deeplabv3+ network model structure, which includes an encoder module and a decoder module. The encoder module consists of a feature extraction network Mobilenetv2, a feature pyramid network ASPP, and a point convolutional layer. The decoder module receives the results of the main encoding branch and low-level feature mapping, builds an upsampling module after passing through the point convolutional layer, and finally completes the preliminary test.

6. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: In step S5, the loss function is optimized, as follows: The formula for adding Focal and SSIM loss functions to the binary cross-entropy loss is as follows: Loss = L BCE + L Focal + L SSIM in: Loss For loss function, L BCE for BCE loss function L Focal for Focal loss function L SSIM for SSIM Loss function; BCE The loss function formula is as follows: in, for x Belongs to the i The predicted probabilities of each category, y i is the truth label, which can be 0 or 1, and N is the number of samples; Focal The loss function formula is as follows: Where α is a factor that balances the weights of positive and negative samples, and is set to 0.25; It is a factor that balances the weights of hard-to-distinguish and easy-to-distinguish samples, and is set to 2; ρ is the probability that the model predicts a sample as positive. The SSIM loss function formula is as follows: Where, μ x μ y and σ x σ y The mean and standard deviation of x and y are respectively, and σ is the standard deviation of x and y. xy To account for its covariance, C1 and C2 are positive constants to avoid division by zero; Where K1 takes the value 0.01, K2 takes the value 0.03, and L = 255.

7. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 6, characterized in that: In step S6, specifically: S61. Divide the oil spill dataset constructed in step S3 into a training set, a validation set, and a test set according to a certain ratio; S62. Training experiment using the data package of the open source project MMDetection. Backbone uses Mobilenetv2, Batch size is set to 4, stochastic gradient descent algorithm is selected as the optimization algorithm, learning rate is set to 0.007, and 2100 images are trained for 50 epochs. S63. Save the models trained in each epoch and select the model with the highest accuracy as the final model.

8. The method for detecting oil spills on the sea surface based on the improved Deeplabv3+ according to claim 1, characterized in that: In step S7, specifically: the model trained in step S6 is validated on the test set, which contains 300 oil spill images of size 256×256, the same as the training set, using remote sensing images from Sentinel-1A satellite in the C-band; accuracy and average intersection-over-union ratio are used as performance indicators, and the number of frames per second (FPS) is used as the speed indicator to evaluate the performance of the oil spill dark spot detection algorithm; The formula for calculating accuracy is as follows: The formula for calculating mIoU is as follows: Among them, TP represents true positive, FP represents false positive, FN represents false negative, and TN represents true negative.