An improved YOLOv11 ship target detection method fusing multi-dimensional attention and a lightweight detection head
By improving the YOLOv11 model and integrating multidimensional attention and a lightweight detection head, the accuracy and robustness issues of ship target detection in harsh environments were resolved. This resulted in efficient adaptive feature extraction and accurate detection, significantly reducing the rates of missed detections and false detections.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIAONING TECHNICAL UNIVERSITY
- Filing Date
- 2026-04-03
- Publication Date
- 2026-07-07
AI Technical Summary
Existing ship target detection models lack accuracy and robustness in harsh environments, especially in complex backgrounds and poor lighting conditions, making it difficult to effectively detect ship targets near the coastline. Furthermore, traditional methods are susceptible to environmental interference, resulting in low detection accuracy and poor real-time performance.
An improved YOLOv11 method integrating multidimensional attention and a lightweight detection head is adopted. Through adaptive convolution, cross-dimensional attention, large receptive field enhancement mechanism and lightweight head structure co-optimization, including C3K2-AK module, Triplet-LSK module and Detect-MBC detection head, combined with WIoUv3 loss function, the feature extraction capability and bounding box regression accuracy are improved.
It improves the accuracy and robustness of ship target detection, reduces the false negative and false positive rates, and enhances the model's detection performance in complex environments, especially its ability to identify multi-scale ship targets under adverse lighting and color difference conditions.
Smart Images

Figure CN122347729A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of target detection and deep learning technology, specifically to an improved YOLOv11 ship target detection method that integrates multidimensional attention and a lightweight detection head. Background Technology
[0002] Improving the ability to identify ship targets is of great strategic significance for safeguarding maritime rights and interests and ensuring maritime traffic safety. However, the complex marine environment, especially the interference of environmental factors such as poor lighting, high color difference and complex sea conditions, restricts the accuracy and robustness of existing ship target detection models.
[0003] Current ship detection methods can be divided into traditional detection methods based on feature design and deep learning methods based on convolutional neural networks. Traditional methods mainly include algorithms based on statistical model threshold segmentation, visual saliency, shape and texture matching, and anomaly detection. While they exhibit some robustness in specific extreme conditions (such as dark-colored ships or sea noise), they generally suffer from low detection accuracy, poor real-time performance, and susceptibility to environmental interference when dealing with complex backgrounds, especially when detecting ship targets near coastlines. These limitations make them unsuitable for ship target detection applications in harsh environments. Convolutional neural network-based target detection models have shown good performance in ship target detection. Two-stage target detection algorithms such as Faster R-CNN and single-stage target detection algorithms such as SSD and the YOLO series have become mainstream methods in the field. However, these methods are mainly suitable for ship detection in environments with excellent lighting conditions and clear target features. For ship detection scenarios with poor lighting and color difference, these methods still have limitations and lack sufficient experimental validation.
[0004] Ship target inspection in harsh environments faces two major challenges: first, the inspection scene is open, with a wide variety of targets and a wide range of sizes; second, various environmental factors such as light refraction, water surface reflection, and monotonous background color blur and obscure image features, increasing the difficulty of target inspection.
[0005] Therefore, it is necessary to design a novel model with multidimensional attention enhancement, dynamic convolution kernel capability, and a lightweight detection head to improve the robustness and accuracy of ship inspection in complex environments. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and propose an improved YOLOv11 ship target detection method that integrates multidimensional attention and a lightweight detection head. Through adaptive convolution, cross-dimensional attention, large receptive field enhancement mechanism and lightweight head structure synergistic optimization, it achieves efficient adaptation to different ship sizes and shapes, enhances the ability to extract key features of ship targets, reduces the false negative rate and false positive rate of the model, and improves detection accuracy.
[0007] To achieve the above objectives, this invention designs an improved YOLOv11 ship target detection method that integrates multidimensional attention and a lightweight detection head, comprising the following steps:
[0008] S1: Introducing the C3K2-AK module, which applies adaptive kernel convolution (AKConv) to spatial feature extraction, dynamically adjusting the sampling shape and scale of the convolution kernel according to the input features, and using a channel compression branch of 1×1 convolution;
[0009] S2: Design a channel-space composite attention module Triplet-LSK in the neck network. This module includes: calculating attention weights in three different dimensions from the perspective of cross-dimensional interaction; and fusing a spatial selection mechanism to dynamically combine multi-scale depthwise separable convolution results based on weights.
[0010] S3: Propose a new Detect-MBC detection head, including MBConv dimensionality upscaling, depthwise convolution, dimensionality reduction operations, and SE attention mechanism;
[0011] S4: The new WIoUv3 loss function is used to replace CIoU in the original YOLOv11 as the bounding box regression loss function, which is used to adaptively allocate gradient gain according to the outlier degree of the predicted box.
[0012] Furthermore, step S1 is detailed as follows:
[0013] Building upon Bottleneck, a novel Bottleneck-AK structure is proposed. This structure applies the adaptive kernel convolution AKConv to the 3×3 convolutional layer responsible for spatial feature extraction in Bottleneck, allowing the convolutional kernel to adaptively adjust its size and shape based on the input feature map, more effectively adapting to changes in the ship target. Meanwhile, the 1×1 convolutional layer responsible for channel management retains its original efficient form, maximizing model efficiency. This hybrid design maximizes the accuracy advantages of AKConv while minimizing the negative impact on model speed and parameter count.
[0014] Compared to traditional fixed convolutional kernels, the C3K2-AK module utilizes AKConv to overcome its limitations of fixed local windows and preset sampling shapes, achieving feature adaptation. By allowing convolutional kernels to have any number of parameters and flexible sampling shapes, it can dynamically adjust according to the actual needs of the feature map. This is the core mechanism of C3K2-AK module's feature adaptation. Furthermore, to more effectively adapt to significant changes in the size of ship targets, the module designs and generates initial sampling coordinates for convolutional kernels of different scales, thereby improving the model's flexibility and efficiency when processing multi-sized targets. Simultaneously, the C3K2-AK module supports linear increases and decreases in the number of convolutional parameters, enabling performance optimization in different hardware environments.
[0015] Setting the built-in parameter C3K=True will revert the structure to the original YOLOv11 model's C3K2 structure; while setting C3K=False will use the designed C3K2-AK structure. The specific parameters of C3K remain consistent with the original model without any additional modifications. This switching mechanism ensures that the model better adapts to the true shape and pose of the detected target based on the actual application scenario, extracting more effective features.
[0016] Furthermore, step S2 is detailed as follows:
[0017] The core idea of attention mechanisms is to simulate human visual perception by assigning differentiated attention weights to different regions of the feature map to enhance the expression of important features and suppress unnecessary redundant information. In target detection algorithms based on visual attention mechanisms, attention mechanisms are used to enhance the distinction between targets and backgrounds, thereby improving detection performance. To address the problems in ship detection tasks caused by environmental factors such as poor lighting and color differences, which lead to ship targets being easily confused with background noise and insufficient feature information extraction, a channel-space composite attention mechanism, Triplet-LSK, was designed.
[0018] Triplet-LSK combines the advantages of channel attention and spatial attention mechanisms. Utilizing a spatial selection mechanism, it calculates attention weights across three different dimensions, assigning the model receptive fields of varying scales. This allows it to capture and process contextual information of the detected object, suppressing non-stationary noise generated by sea clutter and light refraction, and improving the model's ship target detection performance in complex environments. Triplet-LSK consists of two parts: the Triple submodule and the LSK (Large Selective Kernel) submodule.
[0019] S201: Triplet submodule;
[0020] The core Triplet submodule aims to capture cross-dimensional dependencies. Its structure consists of three parallel branches, each used to establish inter-channel relationships and compute attention weights across different dimensions. The top-level branch establishes channel dimensions through a permutation operation. ) and height spatial dimension ( The connection is used to capture Attention weights for dimensions. The intermediate branches establish channel dimensions through permutation operations (…). ) and width spatial dimension ( The connection between ) and calculation Attention weights for each dimension. The bottom branch focuses on spatial relevance and calculates the height ( ) and width ( Weights between dimensions.
[0021] Before calculating the attention weights, each branch passes through a feature aggregation module, Z-POOL, which consists of Global Average Pooling (GAP) and Global Max Pooling (GMP) for efficient feature compression. The weights calculated from the three branches are then summed through a simple averaging operation to obtain the final refined feature map.
[0022] Top-level branches are used to establish and Interaction between dimensions, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together :
[0023]
[0024]
[0025]
[0026] After a Layers will be dimensions Mapping to one dimension :
[0027]
[0028] Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. ,along Rotating the axis clockwise restores the original input shape, resulting in... :
[0029]
[0030]
[0031] Middle branches are used to establish and Interaction between them, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together The principle and structure are similar to those of the top-level branch, ultimately leading to... :
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038] Bottom branches are used to build and The relationship between dimensions, input tensor Aggregated by the Z-pool module The max-pooling feature and average-pooling feature representations of dimension are concatenated to obtain :
[0039]
[0040]
[0041]
[0042] After a Layer will Dimensional mapping to one dimension :
[0043]
[0044] Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. :
[0045]
[0046]
[0047] The output of the Triplet submodule is... , , The average value is used to obtain the result.
[0048] S202: LSK submodule;
[0049] The LSK module uses adaptive large kernel convolution and dynamic weight allocation to perform scale calibration on the feature maps enhanced in the first stage. In view of the significant differences in the size of ship targets in the dataset, LSK extracts multi-path spatial features through cascaded large-scale deep convolution kernels and uses a spatial selection mechanism to dynamically adjust the weights of different receptive field branches, so that the model can adaptively switch receptive fields according to the target size, thereby alleviating the feature distortion problem when a single-scale receptive field faces multi-scale ship targets.
[0050] In the multi-scale feature extraction part, LSK processes the input feature map. Construct feature paths with different receptive fields using cascaded depthwise separable convolutions (5×5 and 7×7). and To achieve dynamic spatial selection, LSK performs channel dimensionality reduction using 1×1 convolution, then aggregates contextual background information and ship target salient features using spatial average pooling and max pooling to generate spatial selection weight maps for targets at different scales. Finally, LSK dynamically aggregates multi-scale branches based on the generated weights and recalibrates the input feature map using a gating method, thus suppressing sea surface clutter and noise interference while highlighting the features of the ship target region. The calculation process is shown in the following equation:
[0051]
[0052]
[0053]
[0054]
[0055]
[0056] in, , These represent depthwise separable convolutions of 5×5 and 7×7, respectively. This represents the feature path after dimensionality reduction of the channel. , These represent average pooling and max pooling, respectively. It is a 7×7 convolution. This is a dual-channel spatial weight map, with channel 1 corresponding to... Small core weight, corresponding to channel 2 Large core weight, This indicates element-wise multiplication. This represents the attention map after dimension restoration, which incorporates optimal scale information and restores the number of channels to the desired value via a 1×1 convolution. , This indicates the final output of the Triplet-LSK module.
[0057] Through this cascaded design approach that moves from spatial location to scale-adaptive perception, the Triplet-LSK module enhances the model's ability to represent multi-scale ship targets in complex environments without significantly increasing computational overhead, and strengthens the model's performance in visual tasks such as classification, detection, and segmentation.
[0058] Furthermore, the MBConv structure in step S3 is specifically divided into five parts: pointwise convolution (dimensionality increase), depthwise separable convolution, SE module, pointwise convolution (dimensionality reduction), and Shortcut connection.
[0059] MBConv's core lies in its efficient, step-by-step feature processing workflow, structured into five parts: pointwise convolution (dimensionality increase), depthwise separable convolution, SE module, pointwise convolution (dimensionality reduction), and Shortcut connections. A 1×1 pointwise convolution expands the input feature map's channel count (dimensionality increase), providing richer information space for subsequent spatial feature extraction. Depthwise separable convolution is used for processing, while pointwise convolution weights and combines the feature map along the channel dimension, reducing the model's computational cost and parameter count. The SE module enhances the feature information extraction capability along the channel dimension. Another 1×1 pointwise convolution performs feature compression and fusion (dimensionality reduction), restoring the feature channel count to a dimension close to the input, further controlling the model's computational cost and parameter count. When the input and output dimensions are the same, Shortcut connections are used to directly superimpose the original input features with the MBConv-processed output, achieving feature reuse, solving the gradient vanishing problem during training, and improving the model's training stability and convergence ability.
[0060] Furthermore, step S4 is detailed as follows:
[0061] Existing object detection work often assumes that the samples in the training dataset are of high quality and uniformly distributed. The CIoU loss function used in the original YOLOv11 model has limitations in complex detection scenarios such as uneven distribution of the number and location of targets, poor lighting and color difference, which lead to a decline in sample quality. Blindly increasing the weight of bounding box regression on low-quality samples can introduce harmful gradients and impair the model's localization performance.
[0062] To address this, the Wise-IoUv3 (WIoUv3) loss function is used instead of the CIoU loss function in the original YOLOv11 as the bounding box regression loss function. Its core lies in introducing a dynamic non-monotonic focusing mechanism, using "outlier" instead of the traditional... The overlap of the predicted boxes is used to evaluate their quality; this mechanism can provide a more beneficial gradient gain allocation strategy, effectively reducing competition for high-quality predicted boxes, while suppressing harmful gradients generated by low-quality samples (outliers), so that WIoUv3 can focus more on the accurate localization of predicted boxes of ordinary quality, and ultimately significantly improve the overall performance of the model and its robustness to complex samples.
[0063] WIoUv1 constructed an attention-based bounding box loss, while WIoUv3 builds upon this by constructing a gradient gain (focusing coefficient) calculation method to add a focusing mechanism; specifically defined as:
[0064]
[0065]
[0066] in, and This represents the coordinates of the center points of the predicted bounding box and the ground truth bounding box. , Indicates the minimum bounding box size, superscript This indicates that it is separated from the computation graph to prevent the generation of gradients that hinder convergence. Representing predicted bounding boxes and ground truth bounding boxes Loss; when the predicted bounding box and the regression bounding box overlap well, It will significantly amplify the ordinary quality prediction box. High-quality prediction boxes It will significantly reduce This makes it focus on the distance between the center points;
[0067]
[0068]
[0069]
[0070] in, express The exponential moving average, Indicates the degree of outlier. Indicates the non-monotonic focusing coefficient;
[0071] When the outlier level of the predicted bounding box meets the following conditions ( When the gradient is constant, the predicted box will receive the highest gradient gain; because It is dynamic, and the quality criteria for predicting boxes also change accordingly, enabling WIoUv3 to make the gradient gain allocation strategy that best suits the current situation at each time step.
[0072] The improved YOLOv11 ship target detection method provided by this invention, which integrates multidimensional attention and a lightweight detection head, has the following advantages:
[0073] 1. The Triplet-LSK module adopted can effectively extract the features of ship targets at different scales and spatial locations through cross-dimensional attention modeling, which enhances the ability to identify ship targets in complex environments, especially in harsh lighting and color difference environments, thus improving detection accuracy.
[0074] 2. The C3K2-AK module introduces adaptive kernel convolution (AKConv), which can dynamically adjust the size and shape of the convolution kernel according to the different sizes and shapes of ship targets. Compared with traditional fixed convolution kernels, it can extract ship features more accurately and improve the robustness and flexibility of the model in the detection of ship targets of different sizes.
[0075] 3. The proposed Detect-MBC detection head uses MBConv and SE modules. By combining dimensionality increase, depthwise separable convolution and dimensionality reduction, it significantly reduces the amount of computation and parameters, ensuring high-efficiency inference speed.
[0076] 4. The WIoUv3 loss function, by introducing a non-monotonic focusing mechanism based on outlier degree, can effectively allocate gradient gain and focus on the accurate localization of low-quality prediction boxes. Compared with traditional loss functions, this invention can better suppress overfitting of high-quality samples while improving the detection accuracy of low-quality samples, reducing the false negative and false positive rates. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only implementation examples of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0078] Figure 1 Flowchart for improving YOLOv11 network architecture;
[0079] Figure 2 Diagrams of the C3K2-AK structure, Bottleneck-AK structure, and AKConv structure are shown.
[0080] Figure 3 This is a diagram of the Triplet-LSK structure.
[0081] Figure 4 Diagram of the Detect-MBC detection head structure;
[0082] Figure 5 A sample distribution diagram of the SeaShip dataset;
[0083] Figure 6 A partial sample image of the SeaShip dataset;
[0084] Figure 7 This is a partial sample image after data augmentation.
[0085] Figure 8 Comparison chart of different improved detection effects;
[0086] Figure 9 Comparison of detection results under rainy conditions;
[0087] Figure 10 Comparison of detection results in foggy weather;
[0088] Figure 11 A bubble chart comparing model performance;
[0089] Figure 12 This is a comparison chart of test results for different detection algorithms. Detailed Implementation
[0090] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0091] The present invention will be further illustrated below with reference to specific embodiments. Those skilled in the art should understand that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Modifications to the present invention in various equivalent forms all fall within the scope defined by the appended claims.
[0092] This invention discloses an improved YOLOv11 ship target detection method that integrates multidimensional attention and a lightweight detection head. To address the differences in ship type and size, a C3K2-AK module is designed, using adaptive kernel convolution for feature extraction to improve the model's accuracy in extracting features from different types of ships. Secondly, to address the issue of ambiguous ship target feature information, Triplet-LSK channel spatial composite attention is added to enhance the model's global information perception capability, improving the detection performance of small target ships. Finally, to further improve detection accuracy and reduce the number of model parameters and computational cost, Detect-MBC is proposed as a new detection head for the model. The flowchart is shown below. Figure 1 As shown, the specific steps are as follows:
[0093] S1: Introducing the C3K2-AK module, which applies adaptive kernel convolution (AKConv) to spatial feature extraction, dynamically adjusting the sampling shape and scale of the convolution kernel according to the input features, and using a channel compression branch of 1×1 convolution;
[0094] S2: Design a channel-space composite attention module Triplet-LSK in the neck network. This module includes: calculating attention weights in three different dimensions from the perspective of cross-dimensional interaction; and fusing a spatial selection mechanism to dynamically combine multi-scale depthwise separable convolution results based on weights.
[0095] S3: Propose a new Detect-MBC detection head, including MBConv dimensionality upscaling, depthwise convolution, dimensionality reduction operations, and SE attention mechanism;
[0096] S4: The new WIoUv3 loss function is used to replace CIoU in the original YOLOv11 as the bounding box regression loss function, which is used to adaptively allocate gradient gain according to the outlier degree of the predicted box.
[0097] Furthermore, step S1 is detailed as follows:
[0098] Building upon Bottleneck, a novel Bottleneck-AK structure is proposed. This structure applies the adaptive kernel convolution AKConv to the 3×3 convolutional layer responsible for spatial feature extraction in Bottleneck, allowing the convolutional kernel to adaptively adjust its size and shape based on the input feature map, more effectively adapting to changes in the ship target. Meanwhile, the 1×1 convolutional layer responsible for channel management retains its original efficient form, maximizing model efficiency. This hybrid design maximizes the accuracy advantages of AKConv while minimizing negative impacts on model speed and parameter count. The C3K2-AK structure, Bottleneck-AK structure, and AKConv structure are described below. Figure 2 As shown.
[0099] Compared to traditional fixed convolution kernels, the C3K2-AK module utilizes AKConv to overcome its limitations in fixed local windows and preset sampling shapes, achieving feature adaptation. By allowing convolution kernels to have any number of parameters and flexible sampling shapes, it can dynamically adjust according to the actual needs of the feature map. This is the core mechanism of the C3K2-AK module's feature adaptation. In addition, to more effectively adapt to the significant changes in the size of ship targets, the module designs and generates initial sampling coordinates for convolution kernels of different scales, thereby improving the flexibility and efficiency of the model when processing multi-sized targets. At the same time, the C3K2-AK module supports linearly increasing or decreasing the number of convolution parameters, enabling performance optimization in different hardware environments.
[0100] Setting the built-in parameter C3K=True will revert the structure to the original YOLOv11 model's C3K2 structure; while setting C3K=False will allow the model to use the designed C3K2-AK structure. The specific parameter settings for C3K remain consistent with the original model without any additional modifications. This switching mechanism ensures that the model can better adapt to the true shape and pose of the detected target based on the actual application scenario, and extract more effective features.
[0101] Furthermore, step S2 is detailed as follows:
[0102] The core idea of attention mechanisms is to simulate human visual perception by assigning differentiated attention weights to different regions of the feature map to enhance the expression of important features and suppress unnecessary redundant information. In target detection algorithms based on visual attention mechanisms, these mechanisms are used to enhance the distinction between targets and backgrounds, thereby improving detection performance. To address the problems in ship detection tasks caused by adverse lighting conditions, color differences, and other environmental factors, such as the ease with which ship targets are confused with background noise and insufficient feature information extraction, a channel-space composite attention mechanism, Triplet-LSK, is designed. Its structure is as follows: Figure 3 As shown.
[0103] Triplet-LSK combines the advantages of channel attention and spatial attention mechanisms. Utilizing a spatial selection mechanism, it calculates attention weights across three different dimensions, assigning the model receptive fields of varying scales. This allows it to capture and process contextual information of the detected object, suppressing non-stationary noise generated by sea clutter and light refraction, and improving the model's ship target detection performance in complex environments. Triplet-LSK consists of two parts: the Triple submodule and the LSK (Large Selective Kernel) submodule.
[0104] S201: Triplet submodule;
[0105] The core Triplet submodule aims to capture cross-dimensional dependencies. Its structure consists of three parallel branches, each used to establish inter-channel relationships and compute attention weights across different dimensions. The top-level branch establishes channel dimensions through a permutation operation. ) and height spatial dimension ( The connection is used to capture Attention weights for dimensions. The intermediate branches establish channel dimensions through permutation operations (…). ) and width spatial dimension ( The connection between ) and calculation Attention weights for each dimension. The bottom branch focuses on spatial relevance and calculates the height ( ) and width ( Weights between dimensions.
[0106] Before calculating the attention weights, each branch passes through a feature aggregation module, Z-POOL, which consists of Global Average Pooling (GAP) and Global Max Pooling (GMP) for efficient feature compression. The weights calculated from the three branches are then summed through a simple averaging operation to obtain the final refined feature map.
[0107] Top-level branches are used to establish and Interaction between dimensions, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together :
[0108]
[0109]
[0110]
[0111] After a Layers will be dimensions Mapping to one dimension :
[0112]
[0113] Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. ,along Rotating the axis clockwise restores the original input shape, resulting in... :
[0114]
[0115]
[0116] Middle branches are used to establish and Interaction between them, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together The principle and structure are similar to those of the top-level branch, ultimately leading to... :
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] Bottom branches are used to build and The relationship between dimensions, input tensor Aggregated by the Z-pool module The max-pooling feature and average-pooling feature representations of dimension are concatenated to obtain :
[0124]
[0125]
[0126]
[0127] After a Layer will Dimensional mapping to one dimension :
[0128]
[0129] Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. :
[0130]
[0131]
[0132] The output of the Triplet submodule is... , , The average value is used to obtain the result.
[0133] S202: LSK submodule;
[0134] The LSK module uses adaptive large kernel convolution and dynamic weight allocation to perform scale calibration on the feature maps enhanced in the first stage. In view of the significant differences in the size of ship targets in the dataset, LSK extracts multi-path spatial features through cascaded large-scale deep convolution kernels and uses a spatial selection mechanism to dynamically adjust the weights of different receptive field branches, so that the model can adaptively switch receptive fields according to the target size, thereby alleviating the feature distortion problem when a single-scale receptive field faces multi-scale ship targets.
[0135] In the multi-scale feature extraction part, LSK processes the input feature map. Construct feature paths with different receptive fields using cascaded depthwise separable convolutions (5×5 and 7×7). and To achieve dynamic spatial selection, LSK performs channel dimensionality reduction using 1×1 convolution, then aggregates contextual background information and ship target salient features using spatial average pooling and max pooling to generate spatial selection weight maps for targets at different scales. Finally, LSK dynamically aggregates multi-scale branches based on the generated weights and recalibrates the input feature map using a gating method, thus suppressing sea surface clutter and noise interference while highlighting the features of the ship target region. The calculation process is shown in the following equation:
[0136]
[0137]
[0138]
[0139]
[0140]
[0141] in, , These represent depthwise separable convolutions of 5×5 and 7×7, respectively. This represents the feature path after dimensionality reduction of the channel. , These represent average pooling and max pooling, respectively. It is a 7×7 convolution. This is a dual-channel spatial weight map, with channel 1 corresponding to... Small core weight, corresponding to channel 2 Large core weight, This indicates element-wise multiplication. This represents the attention map after dimension restoration, which incorporates optimal scale information and restores the number of channels to the desired value via a 1×1 convolution. , This indicates the final output of the Triplet-LSK module.
[0142] Through this cascaded design approach that moves from spatial location to scale-adaptive perception, the Triplet-LSK module enhances the model's ability to represent multi-scale ship targets in complex environments without significantly increasing computational overhead, and strengthens the model's performance in visual tasks such as classification, detection, and segmentation.
[0143] Furthermore, in step S3, the MBConv structure is specifically divided into five parts: pointwise convolution (dimensionality increase), depthwise separable convolution, SE module, pointwise convolution (dimensionality reduction), and Shortcut connection; the Detect-MBC structure and MBConv structure are as follows: Figure 4 As shown.
[0144] MBConv's core lies in its efficient, step-by-step feature processing workflow, structured into five parts: pointwise convolution (dimensionality increase), depthwise separable convolution, SE module, pointwise convolution (dimensionality reduction), and Shortcut connections. First, 1×1 pointwise convolution expands the input feature map's channel count (dimensionality increase), providing richer information space for subsequent spatial feature extraction. Depthwise separable convolution is used for processing, while pointwise convolution weights and combines the feature maps along the channel dimension, reducing the model's computational cost and parameter count. The SE module enhances the feature information extraction capability along the channel dimension. Another 1×1 pointwise convolution performs feature compression and fusion (dimensionality reduction), restoring the feature channel count to a dimension close to the input, further controlling the model's computational cost and parameter count. When the input and output dimensions are the same, Shortcut connections are used to directly superimpose the original input features with the MBConv-processed output, achieving feature reuse, solving the gradient vanishing problem during training, and improving the model's training stability and convergence ability.
[0145] Furthermore, step S4 is detailed as follows:
[0146] Current object detection methods often assume that the training dataset contains high-quality, uniformly distributed samples. The CIoU loss function used in the original YOLOv11 model has limitations in complex detection scenarios, such as uneven distribution of the number and location of targets, poor lighting, and color differences that lead to a decline in sample quality. Blindly increasing the weights of bounding box regression on low-quality samples can introduce harmful gradients and impair the model's localization performance.
[0147] To address this, the Wise-IoUv3 (WIoUv3) loss function is used instead of the CIoU loss function in the original YOLOv11 as the bounding box regression loss function. Its core lies in introducing a dynamic non-monotonic focusing mechanism, using "outlier" instead of the traditional... The overlap of the predicted bounding boxes is used to evaluate their quality. This mechanism provides a more beneficial gradient gain allocation strategy, effectively reducing competition for high-quality predicted bounding boxes while suppressing harmful gradients generated by low-quality samples (outliers). This allows WIoUv3 to focus more on the accurate localization of predicted bounding boxes of average quality, ultimately significantly improving the overall performance of the model and its robustness to complex samples.
[0148] WIoUv1 constructed an attention-based bounding box loss, while WIoUv3 builds upon this by constructing a gradient gain (focusing coefficient) calculation method to add a focusing mechanism; specifically defined as:
[0149]
[0150]
[0151] in, and This represents the coordinates of the center points of the predicted bounding box and the ground truth bounding box. , Indicates the minimum bounding box size, superscript This indicates that it is separated from the computation graph to prevent the generation of gradients that hinder convergence. Representing predicted bounding boxes and ground truth bounding boxes Loss; when the predicted bounding box and the regression bounding box overlap well, It will significantly amplify the ordinary quality prediction box. High-quality prediction boxes It will significantly reduce This makes it focus on the distance between the center points;
[0152]
[0153]
[0154]
[0155] in, express The exponential moving average, Indicates the degree of outlier. Indicates the non-monotonic focusing coefficient;
[0156] When the outlier level of the predicted bounding box meets the following conditions ( When the gradient is constant, the predicted box will receive the highest gradient gain; because It is dynamic, and the quality criteria for predicting boxes also change accordingly, enabling WIoUv3 to make the gradient gain allocation strategy that best suits the current situation at each time step.
[0157] Ship inspection model experiment
[0158] The experiment uses the typical aquatic target dataset—SeaShip. The SeaShip dataset contains 7000 images, all with a resolution of 1920x1080 pixels. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio.
[0159] The SeaShip dataset covers six different types of ship targets: ore carriers, passenger ships, container ships, bulk cargo carriers, general cargo ships, and fishing ships. This rich dataset includes ship samples of different types, sizes, and distances, and can simulate real-world ship target detection under various lighting and color difference environments in normal weather conditions, providing a solid foundation for model performance validation. The dataset sample distribution and some sample examples are shown below. Figure 5 , Figure 6 As shown.
[0160] In ship target detection, complex weather conditions can significantly impact the model's detection accuracy and efficiency. To comprehensively evaluate the model's performance and generalization ability in real-world applications, detection results under complex weather conditions are used to verify the model's effectiveness and practicality.
[0161] The SeaShip dataset lacks samples covering complex weather environments. To address this issue, OpenCV was applied to the test set samples to simulate rainy and foggy conditions by overlaying random raindrop textures and adding Gaussian noise, respectively. The model was then tested in the augmented rainy and foggy environments to further verify its performance and robustness. The parameter settings for data augmentation and some augmented samples are shown in Table 1. Figure 7As shown.
[0162] Table 1 Data Augmentation Parameter Settings parameter Influencing variables Numerical range Value num_drops Number of raindrops 50-150 image.shape[0] / / 35 drop_length Raindrop length 10-30 pixels image.shape[1] / / 30 colors Raindrop Colors RGB element list [(200, 200, 200), (150, 150, 150)] loc Average fog brightness 0-255 128 scale fog standard deviation 10-30 10
[0163] The experiment used evaluation metrics such as F1 score (F1), average precision (AP), mean average precision (mAP), precision (P), and recall (R) to evaluate and analyze the experimental results.
[0164]
[0165]
[0166]
[0167]
[0168]
[0169] in, This indicates that the positive sample was correctly identified. This represents a false positive sample identification. This represents a misidentification of negative samples. Indicates the number of sample categories identified. This represents the sum of the average precision of samples from each category in the dataset.
[0170] ablation experiment
[0171] First, experiments were conducted on the SeaShip dataset to verify the effectiveness of the improved method. The models are represented as follows: (1) YOLOv11, (2) YOLOv11+C3K2-AK, (3) YOLOv11+Triplet-LSK, (4) YOLOv11+WIoUv3, (5) YOLOv11+C3K2-AK+Triplet-LSK, (6) YOLOv11+C3K2-AK+WIoUv3, (7) YOLOv11+Triplet-LSK+WIoUv3, (8) YOLOv11+C3K2-AK+Triplet-LSK+WIoUv3, (9) YOLOv11+C3K2-AK+Triplet-LSK+WIoUv3+Detect-MBC. The experimental results are shown in Table 2.
[0172] Table 2 Ablation Experiment Results of SeaShip Dataset Model Parameter quantity / M Computational cost / G Precision / % Recall / % mAP@50 / % mAP@50-95% F1 / % (1) 2.58 6.3 89.4 86.6 93.2 63.1 87.9 (2) 2.46 6.1 93.7 91.8 96.9 71.5 92.7 (3) 3.11 12.1 94.2 95.2 97.6 75.9 94.7 (4) 2.58 6.3 96.0 92.6 96.8 74.5 94.3 (5) 2.99 11.9 94.8 93.1 96.9 71.5 93.9 (6) 2.46 6.1 97.4 92.2 97.1 73.7 94.7 (7) 3.11 12.1 94.4 97.5 97.5 76.8 95.9 (8) 2.99 11.9 96.1 92.3 97.2 74.6 94.2 (9) 2.64 9.3 97.0 95.7 98.4 76.4 96.4
[0173] As shown in Table 2, C3K2-AK achieves a lightweight model while maintaining feature extraction capabilities, with a slight decrease in parameter and computational costs. Introducing Triplet-LSK significantly improves the model's ability to recognize ship features and enhances feature extraction, but the complex attention mechanism also leads to a substantial increase in model size. The improved WIoUv3 loss function, through a dynamic non-monotonic focusing mechanism, improves the recognition of various small-volume ship targets without affecting model size or computational cost, and enhances the model's accuracy in locating low-quality bounding boxes and small target ships. The designed Detect-MBC detection head effectively maintains the model's detection performance while significantly reducing model size, successfully mitigating the increased model complexity caused by adding Triplet-LSK and improving the model's deployment potential on edge devices. Triplet-LSK focuses on feature interactions in the channel and spatial dimensions, while C3K2-AK reduces the number of parameters while maintaining accuracy through a flexible convolution mechanism with variable kernel convolution. The combination of the two can comprehensively and effectively extract image features, significantly improving the model's expressive power.
[0174] Compared with the original model, the improved models mAP@50 and mAP@50-95 achieved 98.4% and 76.4% accuracy, respectively, representing improvements of 5.2% and 13.3%, achieving the best performance. Precision and recall improved by 6.6% and 9.1%, respectively, while the F1 score remained at a high level of 96.4%. Although the number of parameters and computational cost increased by 0.06M and 3G, respectively, the experimental results show that the improved model effectively improved the accuracy of ship detection and significantly reduced the probability of missed and false detections, fully demonstrating the effectiveness and necessity of the model improvement method. To visually demonstrate the effect of the improvement measures, a portion of the test set samples are selected for display, and the results are as follows: Figure 8 As shown.
[0175] Depend on Figure 8 It can be seen that the improved model can not only accurately identify different ship targets, but also accurately identify ship targets with blurred feature information under different lighting environments and occlusion conditions. Compared with the original YOLOv11 model, the improved model has a significantly reduced false positive and false negative probability, and also shows high detection performance for ship targets of different types and sizes. To demonstrate the generalization and robustness of the improved model in complex weather scenarios, detection was performed on the data-augmented test set. The detection images for rainy and foggy weather scenarios are shown below. Figure 9 , 10 As shown.
[0176] Depend on Figure 10 , Figure 11As shown, the detection accuracy of the original YOLOv11 model decreased significantly in rainy and foggy weather. The improved model could still accurately identify ship targets in harsh environments without any missed or false detections, indicating that the introduction of improvements such as Triplet-LSK and WIoUv3 enhanced the model's generalization ability in complex weather conditions.
[0177] Comparative experiment
[0178] To verify the superiority of the improved model, eight object detection models were selected and tested on the dataset. The results are shown in Table 3 and... Figure 11 As shown. Figure 12 The horizontal axis represents the model's computational cost, the vertical axis represents the model's mAP@50-95, and the bubble volume represents the number of model parameters.
[0179] Table 3 Comparison Experiment Results of SeaShip Dataset Model Parameter quantity / M Computational cost / G Precision / % Recall / % mAP@50 / % mAP@50-95% F1 / % YOLOv3 12.13 18.9 88.2 85.9 91.9 60.8 87.0 YOLOv5 2.20 6.4 88.0 82.8 91.5 60.1 85.5 YOLOv6 4.23 11.8 91.7 87.5 93.8 59.2 89.6 YOLOv8 2.73 7.5 91.5 88.5 94.6 65.5 90.1 YOLOv9 1.87 7.4 92.7 86.8 94.1 64.7 89.6 YOLOv10 2.08 6.0 81.0 77.4 86.3 59.1 79.2 YOLOv11 2.58 6.3 89.4 86.6 93.2 63.1 87.9 YOLOv12 2.49 6.2 94.0 90.1 95.4 68.2 91.8 Ours 2.64 9.3 97.0 95.7 98.4 76.4 96.4
[0180] From Table 3 and Figure 11 It is evident that the improved model outperforms the other seven target detection models in all performance metrics. Compared to the latest YOLOv12 model, the improved model achieves a 3% increase in precision, a 5.6% increase in recall, a 3% increase in mAP@50, and an 8.2% increase in mAP@50-95, while maintaining a low level of parameter and computational complexity, thus meeting the requirements for ship detection deployed on edge devices.
[0181] To visually demonstrate the detection effectiveness of different models for ship targets, a selection of detection results from each model is presented. The structure is as follows: Figure 12 As shown.
[0182] Depend on Figure 12 It is evident that ship images suffer from overlapping, lighting conditions, and limited image size, resulting in missing feature information and significantly increasing the difficulty of ship target detection. Comparative models all exhibit varying degrees of false positives and false negatives, particularly evident in fishing vessel sample detection. The proposed improved model not only accurately detects various types of ship targets but also achieves a minimum detection accuracy of over 75%, meeting the requirements of practical ship target detection tasks.
[0183] Based on the above experiments, it can be concluded that the improved YOLOv11 ship target detection method designed in this experiment, which integrates multidimensional attention and a lightweight detection head, has high robustness and detection accuracy, outperforming the other seven comparative models in all evaluation indicators and actual detection. It significantly improves detection accuracy and effectively reduces the false negative and false positive rates, addressing problems such as low detection accuracy, high missed detection rate, and high false positive rate caused by poor lighting and color difference.
[0184] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0185] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. An improved YOLOv11 ship target detection method integrating multidimensional attention and a lightweight detection head, characterized in that, The method includes the following steps: S1: Introducing the C3K2-AK module, which applies adaptive kernel convolution (AKConv) to spatial feature extraction, dynamically adjusting the sampling shape and scale of the convolution kernel according to the input features, and using a channel compression branch of 1×1 convolution; S2: Design a channel-space composite attention module Triplet-LSK in the neck network. This module includes: calculating attention weights in three different dimensions from the perspective of cross-dimensional interaction; and fusing a spatial selection mechanism to dynamically combine multi-scale depthwise separable convolution results based on weights. S3: Propose a new Detect-MBC detection head, including MBConv dimensionality upscaling, depthwise convolution, dimensionality reduction operations, and SE attention mechanism; S4: The new WIoUv3 loss function is used to replace CIoU in the original YOLOv11 as the bounding box regression loss function, which is used to adaptively allocate gradient gain according to the outlier degree of the predicted box.
2. The improved YOLOv11 ship target detection method integrating multidimensional attention and a lightweight detection head as described in claim 1, characterized in that, Step S1 is as follows: Building upon Bottleneck, a novel Bottleneck-AK structure is proposed. The adaptive kernel convolution AKConv is applied to the 3×3 convolutional layers responsible for spatial feature extraction in Bottleneck, while the original efficient form of the 1×1 convolutional layers responsible for channel management is retained, maximizing model efficiency. For changes in target pose and shape, the module adjusts the sampling position of irregular convolutional kernels using offsets predicted by AKConv. In terms of deployment and optimization, the C3K2-AK module supports linear increases and decreases in the number of convolutional parameters.
3. The improved YOLOv11 ship target detection method integrating multidimensional attention and a lightweight detection head as described in claim 2, characterized in that, Step S2 is as follows: The core idea of the attention mechanism is to simulate human visual perception by assigning different attention weights to different regions of the feature map to enhance the expression of important features and suppress unnecessary redundant information. In the target detection algorithm based on the visual attention mechanism, the attention mechanism is used to enhance the distinction between the target and the background. Based on this, the channel space composite attention Triplet-LSK was designed. This module consists of two parts: the Triple sub-module and the LSK (Large Selective Kernel) sub-module. S201: Triplet submodule; The core Triplet submodule aims to capture cross-dimensional dependencies. Its structure consists of three parallel branches, each responsible for establishing connections and calculating attention weights across different dimensions. The top-level branch establishes channel dimensions through permutation operations. ) and height spatial dimension ( The connection between ) and calculation Attention weights for dimensions; The intermediate branch establishes the channel dimension through a permutation operation. ) and width spatial dimension ( The connection between ) and calculation Attention weights for dimensions; The bottom branch focuses on spatial correlation and calculates the height ( ) and width ( The weights between dimensions are calculated; before each branch calculates the attention weights, it goes through a feature aggregation module Z-POOL, which consists of global average pooling (GAP) and global max pooling (GMP) for efficient feature compression; the weights calculated from the three branches are summed up through a simple averaging operation; Top-level branches are used to establish and Interaction between dimensions, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together : After a Layers will be dimensions Mapping to one dimension : Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. ,along Rotating the axis clockwise restores the original input shape, resulting in... : Middle branches are used to establish and Interaction between them, input tensor ,along Rotate the axis counterclockwise get Then aggregated by the Z-pool module Dimensional average pooling features and max pooling features spliced together The principle and structure are similar to those of the top-level branch, ultimately leading to... : Bottom branches are used to build and The relationship between dimensions, input tensor Aggregated by the Z-pool module The max-pooling feature and average-pooling feature representations of dimension are concatenated to obtain : After a Layer will Dimensional mapping to one dimension : Will Weight representation is generated through a gating mechanism. and input features Multiplication yields the output of the corresponding branch. : The output of the Triplet submodule is... , , The average value is used to obtain the result. S202: LSK submodule; The LSK module uses adaptive large kernel convolution and dynamic weight allocation to scale the feature map after the first stage enhancement. In view of the significant differences in the size of ship targets in the dataset, LSK extracts multi-path spatial features through cascaded large-scale deep convolution kernels and uses a spatial selection mechanism to dynamically adjust the weights of different receptive field branches. In the multi-scale feature extraction part, LSK processes the input feature map. Construct feature paths with different receptive fields using cascaded depthwise separable convolutions (5×5 and 7×7). and LSK performs channel dimensionality reduction using 1×1 convolutions, then aggregates contextual background information and ship target salient features using spatial average pooling and max pooling to generate spatial selection weight maps for targets at different scales. Finally, LSK dynamically aggregates multi-scale branches based on the generated weights and recalibrates the input feature map using a gating method. The calculation process is shown in the following formula: in, , These represent depthwise separable convolutions of 5×5 and 7×7, respectively. This represents the feature path after dimensionality reduction of the channel. , These represent average pooling and max pooling, respectively. It is a 7×7 convolution. This is a dual-channel spatial weight map, with channel 1 corresponding to... Small core weight, corresponding to channel 2 Large core weight, This indicates element-wise multiplication. This represents the attention map after dimension restoration, which incorporates optimal scale information and restores the number of channels to the desired value via a 1×1 convolution. , This indicates the final output of the Triplet-LSK module.
4. The improved YOLOv11 ship target detection method integrating multidimensional attention and a lightweight detection head as described in claim 3, characterized in that, Step S3 is as follows: The MBConv structure consists of five parts: pointwise convolution (dimensionality increase), depthwise separable convolution, SE module, pointwise convolution (dimensionality reduction), and Shortcut connection. The core of the MBConv architecture lies in its efficient, step-by-step feature processing flow. This flow begins with feature expansion: the input feature map is expanded in terms of channel number (dimensionality increase) through a 1×1 pointwise convolution; efficient processing is performed using depthwise separable convolution, where depthwise convolution is responsible for extracting spatial information of features channel by channel, while the subsequent pointwise convolution performs weighted combination of the feature map in the channel dimension; the SE module is used to further enhance the feature information extraction capability in the channel dimension; feature compression and fusion (dimensionality reduction) are completed through another 1×1 pointwise convolution, restoring the number of feature channels to a dimension close to that of the input, further controlling the computational cost and parameter count of the model; when the input and output sizes are the same, a Shortcut connection is used to directly superimpose the original input features with the output processed by the MBConv block, achieving feature reuse.
5. An improved YOLOv11 ship target detection method integrating multidimensional attention and a lightweight detection head as described in claim 4, characterized in that, Step S4 is as follows: The core of using WIoUv3 lies in introducing a dynamic non-monotonic focusing mechanism, using "outlier" instead of the traditional... The overlap of the predicted bounding boxes is used to evaluate their quality; WIoUv1 constructs an attention-based bounding box loss, while WIoUv3 adds a focusing mechanism by constructing a gradient gain (focusing coefficient) calculation method, specifically defined as: in, and This represents the coordinates of the center points of the predicted bounding box and the ground truth bounding box. , Indicates the minimum bounding box size, superscript This indicates that it is separated from the computation graph to prevent the generation of gradients that hinder convergence. Representing predicted bounding boxes and ground truth bounding boxes Loss; when the predicted bounding box and the regression bounding box overlap well, It will significantly amplify the ordinary quality prediction box. High-quality prediction boxes It will significantly reduce This makes it focus on the distance between the center points; in, express The exponential moving average, Indicates the degree of outlier. Indicates the non-monotonic focusing coefficient; When the outlier level of the predicted bounding box meets the following conditions ( When the gradient is constant, the predicted box will receive the highest gradient gain; because It is dynamic, and the quality criteria for predicting boxes also change accordingly, enabling WIoUv3 to make the gradient gain allocation strategy that best suits the current situation at each time step.