Improved SAR ship detection algorithm based on YOLOv11
By improving the YOLOv11 model, the introduction of BSAM module and Wise-IoUv2 loss function are introduced, and feature extraction and loss function are optimized, which solves the problem of excessive computational volume of traditional models on mobile devices, and efficient and fast SAR ship detection is achieved, improving detection accuracy and robustness.
Patent Information
- Application Number
- CN202510510040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-15
AI Technical Summary
When traditional YOLOv4 or YOLOv5 models are applied on mobile devices with limited resources, the model is too large and the calculation amount is too high, resulting in low detection accuracy and high computing resources consumption, limiting its application range and performance on mobile devices.
The improved YOLOv11 model is adopted to optimize the network architecture, introduce the BSAM module and EMA attention mechanism, and combine the Wise-IoUv2 loss function to optimize the feature extraction and loss function, reduce the complexity of the model and the calculation amount, and improve detection accuracy and robustness.
While maintaining high detection accuracy, the model complexity and computing cost are significantly reduced, efficient and fast SAR ship detection on mobile devices is achieved, and the adaptability and robustness of multi-scenario and multi-scale ship detection is improved.
Smart Images

Figure CN120496069A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision and artificial intelligence technology. Specifically, it is a SAR ship detection algorithm based on an improved YOLOv11, which is used to detect ships in SAR images. Background Art
[0002] With the rapid development of artificial intelligence (AI) technology, the application of computer vision in SAR (Ship Detection) ship detection is becoming increasingly mature. Ship detection, a key subtask of computer vision, aims to identify ships in SAR images and accurately locate them. It holds broad application prospects in maritime surveillance, national defense, and security. By leveraging advanced technologies such as deep learning, ship detection systems can efficiently and accurately monitor maritime targets, providing crucial support and assurance for improving maritime safety and defense surveillance. Maritime ship safety is a matter of considerable concern, particularly in critical and sensitive waters. To enhance maritime safety, SAR (Ship Detection) equipment has been deployed in many regions to monitor abnormal ship behavior. However, traditional ship detection systems suffer from low recognition accuracy and high computational resource consumption, limiting their effectiveness and reliability in practical applications. With the advancement of AI technology, deep learning-based ship detection algorithms are maturing, enabling more accurate identification of ships in SAR images while maintaining accuracy and reducing computational resource consumption, providing a more effective solution for improving maritime safety and defense surveillance.
[0003] In recent years, deep learning-based object detection algorithms have made significant progress. The YOLO (You Only Look Once) series of algorithms has attracted widespread attention for its end-to-end real-time performance and high efficiency. However, when deployed on resource-limited mobile devices, traditional YOLOv4 or YOLOv5 models often face the challenges of excessive model size and high computational complexity, limiting their application scope and performance on mobile devices. To address this issue, researchers are committed to developing an improved lightweight YOLOv11 model, aiming to optimize the model structure and reduce model parameters and computational complexity while maintaining high accuracy. This lightweight model is expected to achieve more efficient and faster object detection on mobile devices, further promoting the development of deep learning technology in the field of intelligent mobile applications.
[0004] To address the limited resources of mobile devices, researchers have proposed a lightweight SAR ship detection algorithm based on an improved YOLOv11. While maintaining high detection accuracy, this algorithm significantly reduces model complexity and computational cost by optimizing the network architecture, employing lightweight model components, and combining model quantization and pruning techniques. This enables efficient and rapid SAR ship detection on mobile devices. This lightweight ship detection algorithm provides a reliable and efficient solution for maritime surveillance and national defense security, providing strong support for improving maritime safety and defense monitoring. Summary of the Invention
[0005] This invention implements a SAR ship detection algorithm based on an improved YOLOv11, addressing the technical problem of difficulty identifying ships in SAR images under various sea conditions. A SAR ship detection algorithm based on an improved YOLOv11 is proposed. During the feature extraction phase, the C3k2 module is improved to better extract ship features from SAR images. The penalty metric is redefined by changing the loss function from CIOU loss to Wise-IoUv2 loss. The Wise-IoUv2 loss further considers the spatial distance and local feature differences between the true and predicted frames, optimizing the shortcomings of traditional loss functions and ultimately achieving accurate prediction results for the entire network.
[0006] In order to achieve the above object, the technical solution of the present invention is as follows: An improved SAR ship detection algorithm based on YOLOv11.
[0007] The specific implementation steps are as follows: Step 1: First, find the SAR ship dataset and divide the dataset into specific proportions; Step 2: After the division is completed, select a suitable model and input the SAR image into the model network; Step 3: Improve the YOLOv11 source code so that it can handle ship detection tasks in various complex sea conditions.
[0008] The specific situation in the step 1 is as follows: The training and validation required for this experiment were performed on the LS-SSDD-v1.0 public dataset. Designed for large-scale scene and small ship target detection, the LS-SSDD-v1.0 dataset was constructed in 2021 by the Institute of Space Information Innovation of the Chinese Academy of Sciences. Based on 15 Sentinel-1 satellite images, 9,000 sub-image slices were generated through preprocessing, regular grid cropping, and manual annotation. A total of approximately 5,000 ship targets were annotated, of which 59.88% were small targets. The dataset features complex scenes, dense targets, and high-resolution original images. To accommodate graphics card memory limitations, the image size was adjusted in the experiment, with a batch size of 16.
[0009] The specific situation in the step 2 is as follows: For model selection, we chose the open-source YOLOv11 model developed by the Ultralytics team as our foundation. YOLOv11 is the latest evolution of the YOLO (You Only Look Once) family. While maintaining the speed advantage of a single-stage detector, it significantly improves the accuracy of multi-scale ship target recognition in complex sea conditions.
[0010] The model demonstrates three breakthrough capabilities in SAR ship detection tasks: Cross-modal feature fusion architecture: The first bidirectional feature pyramid network (BiFPN++) dynamically fuses local ship texture features with global sea surface background information through a cross-scale attention mechanism. It also integrates a dynamic sparse convolution module to automatically enhance the feature response of key target areas in response to common wave and clutter interference in SAR images. Progressive training strategy: Using a curriculum learning mechanism, the training process gradually transitions from clear targets to complex sea conditions with low contrast and high noise. Developing an adversarial data augmentation pipeline to synthesize ship samples in noisy and jammed sea conditions in real time through a generative adversarial network. 3D perception enhancement mechanism: An implicit 3D feature space is constructed through a monocular depth estimation network, significantly improving the accuracy of ship size and heading estimation.
[0011] The specific situation in the step 3 is as follows: Backbone Improvements: We introduce the BSAM module, or dynamic sparse attention dual-layer routing method, at the Backbone layer. For a query, we first filter out irrelevant key-value pairs at the coarse region level, and then apply fine-grained token-to-token attention to the remaining candidate regions (i.e., routing regions). This dual-layer routing attention is simple and effective, significantly reducing computation and memory consumption by leveraging sparsity and relying solely on GPU-friendly dense matrix multiplications.
[0012] Improvements to the C3k2 module: The first two C3k2 modules in the feature extraction phase are improved by integrating the C3k2 module with the EMA attention mechanism, adding the EMA module after the BottleNeck module in C3k2. This improvement abandons the process of calculating the attention map over the entire graph and instead uses the expectation-maximization (EM) algorithm to iterate a set of compact bases, on which the attention mechanism is run, significantly reducing complexity. Improved loss function: Wise-IoU v2 focuses on optimizing the classification branch. By introducing a power-decaying monotonic focusing mechanism, it dynamically adjusts the weight of each sample in the cross-entropy loss: it quickly attenuates the loss contribution of high IoU (easy-to-classify samples) while continuously amplifying the gradient of low IoU (hard-to-classify samples). This allows the network to focus more on low-contrast ship targets obscured by waves or clutter during training, significantly improving the model's detection robustness and recall in complex sea conditions. While retaining the spatial distance attention advantage provided by v1—i.e., using two layers of attention to strengthen the global position alignment of the target box and the ground-truth box and capture local texture details, respectively—this mechanism further breaks through the bottleneck of classification performance and achieves end-to-end fine-grained optimization for SAR ship detection. ; ; ; ; ; BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 BSAM module schematic diagram used in the present invention; Figure 2 A diagram of the open-source YOLOv11 model developed for the Ultralytics team; Figure 3 This is the improved schematic diagram of YOLOv11. DETAILED DESCRIPTION It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings. The technical solution of the present invention will be further described below in conjunction with the drawings and embodiments.
[0013] The present invention provides a SAR ship detection algorithm based on improved YOLOv11, which effectively solves the problem of high missed detection rate of ship detection in current SAR images and performs excellently in multi-scene SAR ship detection.
[0014] First, we constructed a SAR ship dataset. We divided the LS-SSDD-v1.0 dataset into experimental, test, and validation sets. The images were resized to 640x640, and the batch size was set to 16. Next, we improved the model. In the Backbone phase, we first introduced EMA into the C3k2 module, and then added the BSAM dynamic sparse attention mechanism to the last Backbone layer for feature extraction and fusion. When constructing the bounding box loss function, we replaced the original CIOU loss with the Wise-IoUv2 loss function and redefined the penalty metric, ultimately obtaining the network's overall prediction results.
[0015] The specific implementation steps are: Step 1 is to find the SAR ship dataset and divide it into specific proportions. Step 2.1 introduces the BSAM attention mechanism as the final layer of the feature extraction layer to achieve more accurate feature representation for ship target extraction in SAR images. It uses a two-layer routing method with dynamic sparse attention. First, the input query and corresponding key-value pairs are roughly screened at the region level to quickly filter out information that is not relevant to SAR ship target features. Then, within the remaining candidate regions (i.e., routing regions), a fine-grained token-to-token attention mechanism is used to deeply model and aggregate local features. Step 2.2 improves the first two C3k2 modules used for feature extraction by fusing the C3k2 block with the EMA attention mechanism, adding the EMA module before the BottleNeck module in C3k2. This improvement abandons the process of calculating the attention map on the entire graph and instead uses the expectation-maximization (EM) algorithm to iterate a set of compact bases, on which the attention mechanism is run, significantly reducing complexity: Step 3.1: Change the loss function from CIOU Loss to Wise-IoUv2 Loss. Compared with CIOU, Wise-IoUv2 introduces weights when calculating IoU. It assigns higher weights to areas with complex boundaries and prone to errors, and lower weights to background or easily detected areas. This loss function design can better focus on details and edge areas, thereby improving model accuracy. ; ; ; ; ; After completing the improvements to YOLOv11 in Step 3.2, the prepared dataset is passed into the training network. The original C3k2 module is replaced with the improved C3k2_EMA module to enhance multi-scale feature extraction capabilities. Simultaneously, the BSAM (Background Suppression Attention Module) module is introduced into Backbone. This module uses a background suppression mechanism to highlight the ship target area in SAR images, effectively improving detection capabilities in complex backgrounds. Furthermore, an improved WIoU (Wise-IoUv2) mechanism is introduced into the loss function. This mechanism dynamically adjusts the weights of the target box regression process to enhance the model's attention to difficult-to-detect samples. These structural optimizations not only improve the model's accuracy in detecting ships in SAR images, but also maintain detection speed, enhancing its adaptability and robustness in multi-scenario and multi-scale ship detection tasks.
Claims
1. An improved SAR ship detection algorithm based on YOLOv11, characterized in that: The following steps are involved: Step 1: Training network selection, choose the open source YOLOv11 model developed by the Ultralytics team as the basis; Step 2: Input the SAR ship image to be processed, and then input the SAR ship image to be processed by constructing a SAR ship dataset; Step 3: Improve the YOLOv11 model to better extract ship features and predict the output of SAR ship targets.
2. The SAR ship detection algorithm based on the improved YOLOv11 according to claim 1 is characterized in that: The specific process in Step 1 is as follows: Step 1.1 Find the YOLOv11 open source code from the official website, and then build an environment for training.
3. The SAR ship detection algorithm based on the improved YOLOv11 according to claim 1 is characterized in that: The specific process in Step 1 is as follows: Step 2.1 Find the SAR ship dataset from the SAR related website; Step 2.2 Preprocessing of SAR ship data: resize the image to 640x640, set the batch size to 16, and perform data enhancement on the input data, including flipping, translation, and shearing.
4. The SAR ship detection algorithm based on the improved YOLOv11 according to claim 1 is characterized in that: The specific process in Step 3 is as follows: Step 3.1 improves the first two C3k2 modules used for feature extraction by fusing the C3k2 block with the EMA attention mechanism, adding the EMA module before the BottleNeck module in C3k2. This improvement abandons the process of calculating the attention map on the entire graph and instead uses the expectation-maximization (EM) algorithm to iterate a set of compact bases, on which the attention mechanism is applied, significantly reducing complexity. Step 3.2 introduces the BSAM attention mechanism as the final layer of the feature extraction layer to achieve more accurate feature representation for ship target extraction in SAR images. BSAM uses a two-layer routing method with dynamic sparse attention. First, it roughly screens the input query and the corresponding key-value pairs at the region level, quickly filtering out information that is irrelevant to the target features. Then, within the remaining candidate regions (i.e., routing regions), it uses a fine-grained token-to-token attention mechanism to deeply model and aggregate local features. Step 3.3 In terms of loss function, we replaced CIOU Loss with Wise-IoUv2 Loss. Wise-IoU introduces dynamic weights when calculating IoU, giving higher weights to areas with complex boundaries and prone to errors, and lower weights to background or easy-to-detect areas, so that the model can pay more attention to details and edges, thereby improving detection accuracy. On this basis, Wise-IoU v1 uses two layers of distance attention: the first layer quantifies the spatial deviation between the predicted box and the true box in the center and boundary of the ship in the SAR image, and gives global positioning weights; the second layer focuses on local fine-grained features based on the pixel gradient difference between sea clutter and ship echoes, thereby accurately capturing ship details; based on v1, Wise-IoU v2 introduces a power-decayed monotonic focusing mechanism in the classification branch, dynamically attenuating the loss contribution of high IoU easy-to-distinguish samples and amplifying the gradient of low IoU difficult-to-distinguish samples, guiding the network to better identify ship targets in complex sea conditions and low-contrast environments, significantly improving overall robustness and recall rate; ; ; ; ; 。