A SAR image-based ship detection method based on channel decoupling collaboration and shoreline prior.

By employing channel decoupling collaboration and shoreline prior methods, an end-to-end multi-scale mean differential attention network is constructed. This addresses the issues of insufficient feature learning and spatial relationship capture in small-scale ship target detection in SAR images, thereby improving detection accuracy and robustness.

CN122906578BActive Publication Date: 2026-11-17SANYA SCI & EDUCATION INNOVATION PARK WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611409343.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-17
Estimated Expiration
2046-09-11

AI Technical Summary

Technical Problem

Existing deep learning-based SAR image ship detection methods are not sensitive enough to small-scale, low signal-to-noise ratio targets during feature learning, and fail to effectively capture the overall spatial relationships and contextual semantic dependencies of the marine environment, resulting in poor detection performance.

Method used

By employing a channel decoupling collaboration and shore-based prior approach, an end-to-end multi-scale mean-differentiated attention network is constructed through a channel decoupling fusion module, a shore-based prior network module, a channel message passing module, a spatial channel collaboration module, and a shore-based enhanced FPN module, thereby enhancing feature extraction capabilities and ship detection accuracy.

Benefits of technology

It effectively improves the detection accuracy and robustness of complex backgrounds and multi-scale ship targets in SAR images. Experimental results show that it outperforms existing mainstream detection algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906578B_ABST
    Figure CN122906578B_ABST
Patent Text Reader

Abstract

This invention discloses a SAR image ship detection method based on channel decoupling collaboration and shoreline prior, belonging to the fields of smart ocean and computer vision technology. The method includes: acquiring SAR images and preprocessing them; constructing a SAR image ship detection dataset; constructing a SAR image ship detection model; processing the preprocessed SAR images to obtain a collaborative fusion map and a refined attention map; enhancing the features of the collaborative fusion map and the refined attention map to obtain a multi-scale enhanced feature map; and using a detection head to detect the multi-scale enhanced feature map to obtain the ship target classification result. This invention effectively enhances the feature extraction capability of the network, especially achieving significant progress in the detection of fine-grained and cross-scale targets, further improving the accuracy and robustness of ship detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of smart ocean and computer vision technology, specifically to a SAR image ship detection method based on channel decoupling collaboration and shoreline prior. Background Technology

[0002] Synthetic Aperture Radar (SAR) imagery plays an irreplaceable role in maritime traffic monitoring, illegal fishing surveillance, oil spill tracking, maritime rescue, and marine resource protection due to its all-weather, day-and-night imaging capabilities. Detection of ship targets in SAR images is not only a crucial component of maritime intelligent sensing systems but also an important foundation for achieving continuous maritime situational awareness.

[0003] However, SAR images possess unique imaging characteristics such as Gaussian scattering, speckle noise, and multipath effects. Simultaneously, the sea surface environment exhibits highly dynamic changes, causing ships in images to often appear small in scale, weak in structure, with significant morphological differences, and subject to strong background interference. While existing deep learning-based detection methods have made some progress, they still generally face two core challenges: First, the feature learning process lacks sensitivity to small-scale, low signal-to-noise ratio targets, leading to semantic weakening or loss of structural information in high-dimensional features during deep convolutions; second, the models generally rely on local convolution operations, failing to effectively capture the overall spatial relationships and contextual semantic dependencies of the sea environment.

[0004] Therefore, constructing a SAR image ship detection method that simultaneously possesses fine-grained feature representation capabilities, powerful semantic association modeling capabilities, and effectively integrates prior knowledge has significant theoretical and practical value. Summary of the Invention

[0005] To address the aforementioned problems, the present invention aims to provide a SAR image ship detection method based on channel decoupling collaboration and shoreline prior. The technical solution adopted in this invention: A SAR image ship detection method based on channel decoupling collaboration and shoreline prior includes the following steps: S1: Collect SAR images, preprocess them, and construct a SAR image ship detection dataset; S2: Construct a SAR image ship detection model; the SAR image ship detection model includes a channel decoupling and fusion module, a shore-based prior network module, a channel message passing module, a spatial channel coordination module, a shore-based enhancement FPN module, and a detection head; S21: The preprocessed SAR image is simultaneously input into the channel decoupling fusion module and the shore-based prior network module to obtain a fused enhanced feature map and a refined attention map, respectively; the channel decoupling fusion module includes a channel segmentation layer, a differential convolution processing layer, a channel splicing activation layer, a channel weight generation layer, and a weighted residual fusion layer; the shore-based prior network module includes a grayscale conversion and mean convolution layer, a multi-scale difference map generation layer, an attention generation and deep feature extraction layer, and a residual fusion and final attention output layer; S22: Input the fused and enhanced feature map into the channel message passing module to obtain a refined feature map; the channel message passing module includes a global average pooling layer, a channel partitioning layer, a linear mapping layer, an attention weight calculation and normalization layer, an attention message passing layer, and a scaling factor generation and feature calibration layer; S23: Input the refined feature map into the spatial channel collaboration module to obtain a collaboratively fused feature map; the spatial channel collaboration module includes a convolutional projection spatial attention generation layer, a feature aggregation channel response generation layer, and an outer product fusion residual connection layer; S24: Input the collaborative fusion feature map and the refined attention map into the shore-based enhancement FPN module to obtain a multi-scale enhanced feature map. Input the multi-scale enhanced feature map into the detection head to obtain the ship target classification result. The shore-based enhancement FPN module includes a lateral convolution feature construction layer, a selective shore-based attention enhancement layer, and a top-down pyramid fusion layer. S25: Input the preprocessed SAR image into the SAR image ship detection model to calculate the loss function value, and perform backpropagation to obtain the optimized SAR image ship detection model; S3: After preprocessing the SAR image to be tested, input it into the optimized SAR image ship detection model to obtain the ship target classification result.

[0006] Preferably, in step S21, the preprocessed SAR image input channel is decoupled and fused to obtain a fused enhanced feature map. The specific process is as follows: The preprocessed SAR image is input into the channel segmentation layer for proportional segmentation to obtain the backbone feature map and auxiliary feature map. The backbone feature map and auxiliary feature map are input into the differential convolution processing layer to perform convolution nonlinear transformation on the backbone feature map and directly retain the auxiliary feature map to obtain the high-level backbone feature map and auxiliary feature map. The high-level feature map and auxiliary feature map are input into the channel stitching activation layer for channel dimension stitching and nonlinear activation to obtain the single-branch fusion feature map. The preprocessed SAR image is input into the channel weight generation layer, where channel average pooling and mapping are performed to obtain the channel fusion weights. The single-branch fusion feature map and the channel fusion weights are input into the weighted residual fusion layer, and then multiplied and weighted by channel-by-channel and connected to the residuals to obtain the fusion enhanced feature map.

[0007] Preferably, in step S21, the preprocessed SAR image is input into the shore-based prior network module to obtain a refined attention map. The specific process is as follows: The preprocessed SAR image is input into the grayscale conversion and multi-scale convolution preparation layer to convert it into a grayscale image, and a multi-size mean filter kernel is defined to obtain the grayscale image and the multi-scale mean filter kernel; The grayscale image and multi-scale mean filter kernel are input into the multi-scale difference map generation layer. The absolute difference between the grayscale image and the mean filter results at each scale is calculated. Weighted and normalized processing is performed on the absolute difference. The maximum value is taken for the normalized multi-scale results, and then multi-scale fusion is performed to obtain the initial difference map. The initial difference map is input into the attention generation and deep feature extraction layer to obtain the primary attention map. High-level semantic features are extracted, and the primary attention map and multi-layer high-level feature maps are output. The initial difference map, the primary attention map, and the multi-layer high-level feature maps are input into the adaptive residual fusion and final attention output layer to perform residual fusion and feature integration to obtain the refined attention map.

[0008] Preferably, in step S22, the refined feature map is obtained by inputting the fused and enhanced feature map into the message passing module of the channel. The specific process is as follows: S221: Input the fused and enhanced feature map into the global average pooling layer to perform global average pooling to obtain the channel description vector, as shown in the following formula:

[0009] in, Indicates the first The sample, the first Channel-level response values ​​for each channel. This indicates the sequence number of the current sample within the batch. Indicates the first One channel, Indicates the height of the spatial dimension. Indicates the width of the spatial dimension. Indicates the summation index in the height direction. Indicates the summation index in the width direction. This indicates that the fused enhanced feature map contains four dimensions: batch, channel, height, and width. Represents all channel-level response values The channel description vector is composed of Represents the space of real numbers. This indicates the number of samples input into the network at one time. Indicates the number of channels; S222: Input the channel description vector into the channel partitioning layer and proportionally divide it to obtain the teacher channel and the student channel. The specific process is as follows: Using the channel description vector as the processing object, the vector is divided along the channel dimension, with the first part of the vector being the teacher channel and the remaining channels being the student channel; S223: The student input linear mapping layer performs linear mapping to obtain the query matrix; the teacher input linear mapping layer performs linear mapping to obtain the value matrix and key matrix, as shown in the following formula:

[0010] in, Represents the query matrix. Represents the key matrix, Represents a value matrix, This represents the student channel description matrix. This represents the teacher channel description matrix. This represents the learned projection weight matrix of the query matrix. The learned projection weight matrix represents the key matrix. The learning projection weight matrix represents the value matrix. Indicates the number of teacher access channels. Indicates the number of student access channels. Indicates the projection dimension; S224: Input the query matrix and key matrix into the attention weight calculation and normalization layer to calculate the channel attention weights and then normalize them to obtain the attention weight matrix, as shown in the following formula:

[0011] in, Represents the attention weight matrix. express The transpose of the matrix; S225: Input the attention weight matrix and value matrix into the attention message passing layer to perform cross-channel message passing from the teacher channel to the student channel, and obtain the attention feature matrix, as shown in the following formula: , in, Represents the attention feature matrix, Represents a value matrix; S226: Input the attention feature matrix into the scaling factor generation and feature calibration layer, perform a linear mapping transformation, generate adaptive channel scaling factors through Sigmoid activation, and use the scaling factors to calibrate the weights of the student channels to obtain a refined feature map, as shown in the following formula:

[0012] in, The scaling factor tensor of the student channel. This represents the activation function. Represents the linear mapping weight matrix. Represents a refined feature map. This represents the fusion-enhanced feature map. This indicates that the teacher channel's characteristics will be retained in their original values ​​without any modification. For each channel representing a student channel, all pixels at all spatial locations are multiplied by the scaling factor corresponding to that channel.

[0013] Preferably, in step S23, the refined feature map is input into the spatial channel collaboration module to obtain a collaborative fusion feature map. The specific process is as follows: S231: Input the refined feature map into the convolutional projection spatial attention generation layer to obtain a projection feature map and a spatial attention map of the same dimension. The specific process is as follows: The refined feature map is projected onto a feature map of the same dimension through convolution operations to obtain a same-dimensional projected feature map. Then, another convolution in the spatial aggregation branch is used to perform Softmax normalization on the spatial dimension of the refined feature map to obtain a spatial attention map, as shown in the following formula: , in, Representing a spatial attention map, Represents the normalization function. Learning convolutional kernels representing spatial attention, Represents a refined feature map. Represents the number of spatial locations. Indicates the height of the spatial dimension. Indicates the width of a spatial dimension; S232: Input the same-dimensional projected feature map and spatial attention map into the feature aggregation channel response generation layer to obtain the channel response feature map. The specific process is as follows: The same-dimensional projection feature map and the spatial attention map are multiplied by matrix to complete the spatial dimension feature aggregation, resulting in a spatial aggregated feature map. The refined feature map is then weighted using the spatial attention map and summed along the spatial dimension to obtain the channel-level response. The channel-level response is then dimensionally reshaped and multiplied by matrix with the spatial aggregated feature map to obtain the channel response feature map. S233: Input the channel response feature map into the outer product fusion residual connection layer to obtain the co-fusion feature map. The specific process is as follows: The fused feature map is obtained by taking the outer product of the spatial aggregation feature map and the channel response feature map. After reshaping the dimensions, the fused feature map is obtained by adding the residuals of the fused feature map and the refined feature map. The formula is as follows: , , in, Represents the fused feature map. Represents spatial aggregation feature maps, This represents the channel response feature map. This represents element-wise multiplication. This indicates a reshaping operation. Represents the collaborative fusion feature map. This indicates a residual connection.

[0014] Preferably, in step S24, the collaboratively fused feature map and the refined attention map are input into the shore-based enhancement FPN module to obtain a multi-scale enhanced feature map. The specific process is as follows: S241: Input the collaboratively fused feature map into the lateral convolutional feature construction layer, perform channel dimension alignment and feature regularization to obtain the lateral feature map; S242: Input the lateral feature map and the refined attention map into the selective shoreline attention enhancement layer to obtain the attention-enhanced low-level lateral feature map and the unenhanced high-level lateral feature map. The specific process is as follows: First, the refined attention map is scaled to the spatial size of the corresponding lateral feature map through bilinear interpolation to ensure dimension matching. Based on the preset index set, element-wise multiplication of the refined attention map and the lateral feature map is performed only on the low-level lateral feature map, while the high-level feature map is not processed to obtain the attention-enhanced low-level lateral feature map and the unenhanced high-level lateral feature map. S243: Input the low-level lateral feature maps and high-level lateral feature maps into the top-down pyramid fusion layer to obtain multi-scale enhanced feature maps. The specific process is as follows: The high-level lateral feature map is upsampled by bilinear interpolation with a multiplier of 2. The upsampled high-level lateral feature map is then fused element by element with the adjacent low-level lateral feature map. This process completes multi-scale feature completion and semantic transfer from top to bottom, resulting in a multi-scale enhanced feature map.

[0015] The beneficial effects of this invention are: Compared with existing technologies, this invention proposes a SAR image ship detection method based on channel decoupling collaboration and shoreline prior, overcoming the limitations of existing methods in handling complex backgrounds and multi-scale ship targets. By introducing channel splitting and fusion, message passing, and spatial-channel aggregation, the feature extraction capability of the network is effectively enhanced, achieving significant progress, especially in the detection of fine-grained and multi-scale targets. Our end-to-end multi-scale mean-differentiated attention network further improves the accuracy and robustness of ship detection through adaptive fusion and rotating box rasterization attention mechanisms. Experimental results on datasets demonstrate that this method outperforms existing mainstream detection algorithms on multiple metrics. Attached Figure Description

[0016] Figure 1This is a flowchart of a SAR image ship detection method based on channel decoupling collaboration and shoreline prior, according to the present invention.

[0017] Figure 2 This invention presents a network structure diagram of a SAR image ship detection model based on channel decoupling collaboration and shoreline prior.

[0018] Figure 3 The present invention provides a network structure diagram of the shore-based prior network module for a SAR image ship detection method based on channel decoupling collaboration and shore-based prior. Detailed Implementation

[0019] The following detailed description of the implementation of the present invention is provided in conjunction with the accompanying drawings. However, these descriptions do not constitute a limitation of the present invention and are merely examples. Through this description, the advantages of the present invention will be more clearly understood. All modifications that can be directly derived or conceived by those skilled in the art from the content disclosed in the present invention should be considered within the scope of protection of the present invention. Other parts not described in detail in the embodiments are prior art.

[0020] like Figure 1 As shown, the present invention proposes a SAR image ship detection method based on channel decoupling collaboration and shoreline prior, which includes the following steps: S1: Collect SAR images, preprocess them, and construct a SAR image ship detection dataset; The preprocessing process involves: firstly, performing radiometric correction, logarithmic transformation, and normalization on the SAR image, and then copying the single-channel grayscale image into a three-channel image to obtain a fixed-size input tensor. S2: Construct a ship detection model for SAR images, such as Figure 2 As shown; the SAR image ship detection model includes a channel decoupling and fusion module, a shore-based prior network module, a channel message passing module, a spatial channel collaboration module, a shore-based enhanced FPN module, and a detection head; S21: The preprocessed SAR image is simultaneously input into the channel decoupling fusion module and the shore-based prior network module to obtain a fused enhanced feature map and a refined attention map, respectively; the channel decoupling fusion module includes a channel segmentation layer, a differential convolution processing layer, a channel splicing activation layer, a channel weight generation layer, and a weighted residual fusion layer; the shore-based prior network module includes a grayscale conversion and mean convolution layer, a multi-scale difference map generation layer, an attention generation and deep feature extraction layer, and a residual fusion and final attention output layer; The channel decoupling and fusion module is divided into two routes: one is called the channel decoupling and fusion route, and the other is called the cross-channel semantic fusion route. The channel decoupling and fusion route can be further divided into a channel segmentation stage, a differentiation processing stage, and a feature fusion stage. The specific steps are as follows: In the channel segmentation layer, channel decoupling convolution decomposes the preprocessed SAR image. It is divided into two parts in a 1:3 ratio: the main feature map and the auxiliary feature map. The main feature map... Used to learn high-level feature representations, while auxiliary feature maps are used to preserve the original information; In the differential convolutional processing layer, the backbone feature map is transformed non-linearly through the convolutional layer: Meanwhile, the auxiliary feature map remains unchanged: ; In the channel concatenation activation layer, the processed backbone feature map and the retained auxiliary feature map are re-merged along the channel dimension: Finally, the stitched feature map... Applying nonlinear activation functions The single-branch fusion feature map is obtained. ; In the channel weight generation layer, the preprocessed SAR image is... First, use average pooling based on the channel. After two more fully connected transformations, the formula is as follows:

[0021] in, For adaptive channel fusion weights; The weighted residual fusion layer, after passing through two paths, yields single-branch fusion feature maps respectively. Channel fusion weight Multiply the two by their channels to get , in, This indicates multiplication by channel. Then... The data is fed into the DropPath layer, where some channel paths are randomly discarded to improve the model's generalization ability. Finally, compared with the original input Perform residual connection and output. .

[0022] The preprocessed SAR image is input into the shore-based prior network module to obtain a refined attention map. The specific implementation process is as follows: The coastal priori network module can quickly screen areas with differentiated characteristics, significantly improving the efficiency and accuracy of ship inspection, such as... Figure 3 As shown, the specific steps are as follows: Given a preprocessed SAR image We first convert it to a grayscale image. The formula is as follows:

[0023] Then, a mean-difference convolution operation is performed; specifically, a set of mean filter kernels of different sizes are defined. ,in filter kernel size To cover ship targets of different scales. The weight of each mean filter kernel is... For each filter kernel The formula for calculating the local mean plot is as follows:

[0024] in, This indicates a convolution operation; the local difference map is obtained by calculating the absolute difference between the grayscale image and the local mean. To improve the model's adaptability, learnable weights are introduced. The difference maps at different scales are weighted and then normalized using the following formula:

[0025] The final multi-scale difference map is obtained by taking the maximum value of the difference maps at each scale, thus obtaining the initial difference map. Then, the formula is as follows:

[0026] Obtain the initial difference map Next, it is first converted into an attention map using the Sigmoid function, as shown in the following formula:

[0027] in, These are learnable edge weight parameters. Next, a series of convolutional layers are used to expand the receptive field and extract higher-level features, as shown in the following formula:

[0028] To simultaneously preserve both the original difference information and high-level semantic features, adaptive spatial residual fusion is employed, as shown in the following formula:

[0029] The final attention map is passed through an additional convolutional layer, as shown in the following formula:

[0030] S22: Input the fused and enhanced feature map into the channel message passing module to obtain a refined feature map; the channel message passing module includes a global average pooling layer, a channel partitioning layer, a linear mapping layer, an attention weight calculation and normalization layer, an attention message passing layer, and a scaling factor generation and feature calibration layer; The channel message passing module proportionally splits the input channel into "teacher" and "student" channels. Through the attention message passing mechanism in the graph neural network, the student channel can dynamically obtain contextual information from the teacher channel, achieving adaptive feature recalibration. The specific steps are as follows: For a given fused enhanced feature map The channel message passing module first performs global average pooling to obtain the channel description vector, as shown in the following formula:

[0031] Among them, take the first one One channel serves as a teacher's channel, later Each channel is designated as a student channel and is divided into: Then, the query matrix, key matrix, and value matrix are obtained through linear mapping, as shown in the following formula:

[0032] The query matrix and key matrix are input into the attention weight calculation and normalization layer to calculate the channel attention weights and then normalized to obtain the attention weight matrix, as shown in the following formula:

[0033] in, Represents the attention weight matrix. express The transpose of the matrix; The attention weight matrix and value matrix are input into the attention message passing layer to perform cross-channel message passing from the teacher channel to the student channel, resulting in the attention feature matrix, as shown in the following formula:

[0034] in, Represents the attention feature matrix, Represents a value matrix; The attention feature matrix is ​​input into the scaling factor generation and feature calibration layer, and a linear mapping transformation is performed. Adaptive channel scaling factors are generated through Sigmoid activation. These scaling factors are then used to calibrate the weights of the student channels, resulting in a refined feature map. The formula is as follows:

[0035] in, The scaling factor tensor of the student channel. This represents the activation function. Represents the linear mapping weight matrix. Represents a refined feature map. This represents the fusion-enhanced feature map. This indicates that the teacher channel's characteristics will be retained in their original values ​​without any modification. For each channel representing a student channel, all pixels at all spatial locations are multiplied by the scaling factor corresponding to that channel.

[0036] S23: Input the refined feature map into the spatial channel collaboration module to obtain collaboratively fused features; the spatial channel collaboration module includes a convolutional projection spatial attention generation layer, a feature aggregation channel response generation layer, and an outer product fusion residual connection layer; The spatial channel collaboration module introduces spatial aggregation branches and channel aggregation branches on the refined feature map, and realizes cross-dimensional information interaction through bidirectional matrix multiplication. The specific steps are as follows: First, project the image into a feature map of the same dimension using a 1×1 convolution. The spatial aggregation branch generates a spatial attention map through another 1×1 convolution. Then, another convolution in the spatial aggregation branch performs Softmax normalization on the spatial dimension of the refined feature map to obtain the spatial attention map, as shown in the following formula: , in, Representing a spatial attention map, Represents the normalization function. Learning convolutional kernels representing spatial attention, Represents a refined feature map. Represents the number of spatial locations. Indicates the height of the spatial dimension. Indicates the width of a spatial dimension; Projected feature maps of the same dimension and Perform matrix multiplication aggregation The channel branch also generates a spatial attention map, and the input features are weighted according to this attention and summed in the spatial dimension to obtain the channel-level response, as shown in the following formula:

[0037] Will Reshape and Perform matrix multiplication ; Will and The fused features are obtained by performing an outer product, as shown in the following formula:

[0038] And reshaped into The residual is then added to the input, as shown in the following formula:

[0039] S24: Input the collaborative fusion feature map and the refined attention map into the shore-based enhancement FPN module to obtain a multi-scale enhanced feature map. Input the multi-scale enhanced feature map into the detection head to obtain the ship target classification result. The shore-based enhancement FPN module includes a lateral convolution feature construction layer, a selective shore-based attention enhancement layer, and a top-down pyramid fusion layer. To effectively integrate the attention map generated by the shore-based prior network module with the feature pyramid network, the shore-based enhanced FPN module employs a selective attention enhancement mechanism. This mechanism is based on the multi-scale features extracted by the backbone network. ,in and These represent the start and end levels, and the attention map generated by the shore-based prior network module, respectively. First, the original lateral features are constructed using lateral convolution, as shown in the following formula:

[0040] For the specified application index set The attention map is selectively incorporated into the corresponding lateral features, as shown in the following formula:

[0041] in This indicates that bilinear interpolation adjusts the attention map to... Space dimensions, This represents element-wise multiplication. Experiments have shown that... It should be selected as This means that attention enhancement is applied only to low-level features to avoid excessive interference with high-level features. Then, following the top-down path construction process of the standard FPN, the formula is as follows:

[0042] in, This indicates an upsampling operation, typically a bilinear interpolation with a factor of 2.

[0043] S25: Input the preprocessed SAR image into the SAR image ship detection model to calculate the loss function value, and perform backpropagation to obtain the optimized SAR image ship detection model; Calculate the total loss function value of the model, including the adaptive boundary loss function. Classification loss (using cross-entropy) Regression loss (using (or GIoU loss) The three parts, the total loss function of the model The calculation formula is:

[0044] in, and These are the weighting coefficients for the three types of losses, set to the default value. =1.0, =1.0, =1.0, this weight ratio is stable on the validation set, effectively balancing detection performance and attention constraint strength; Given an attention graph and the corresponding list of actual annotation boxes Each of them Include There are 1 rotating frame, each rotating frame is represented as... The calculation process for the attention box alignment loss is as follows: First, the rotated box is rasterized into a binary mask through precise geometric transformation. The formula is as follows:

[0045] Among them, when pixel Located in the b The arbitrary rotation frame of the image At that time, ,otherwise For any point Determine if it is within the rotating frame In this case, we use a coordinate transformation method, as shown in the following formula:

[0046] point The condition for being within the rotating frame is Based on rasterized masks, an adaptive boundary loss function was designed, as shown in the following formula:

[0047] in, This represents the Sigmoid function, which normalizes attention values ​​to the [0,1] region.

[0048] S3: After preprocessing the SAR image to be tested, input it into the optimized SAR image ship detection model to obtain the ship target classification result; Although preferred embodiments of this application have been described, those skilled in the art, once they learn the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. If such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A SAR image ship detection method based on channel decoupling, collaboration and coastal priori, characterized in that, include: S1: Collect SAR images, preprocess them, and construct a SAR image ship detection dataset; S2: Construct a SAR image ship detection model; the SAR image ship detection model includes a channel decoupling and fusion module, a shore-based prior network module, a channel message passing module, a spatial channel coordination module, a shore-based enhancement FPN module, and a detection head; S21: The preprocessed SAR image is simultaneously input into the channel decoupling fusion module and the shore-based prior network module to obtain a fused enhanced feature map and a refined attention map, respectively; the channel decoupling fusion module includes a channel segmentation layer, a differential convolution processing layer, a channel splicing activation layer, a channel weight generation layer, and a weighted residual fusion layer; the shore-based prior network module includes a grayscale conversion and mean convolution layer, a multi-scale difference map generation layer, an attention generation and deep feature extraction layer, and a residual fusion and final attention output layer; The preprocessed SAR image is input into the grayscale conversion and multi-scale convolution preparation layer to convert it into a grayscale image, and a multi-size mean filter kernel is defined to obtain the grayscale image and the multi-scale mean filter kernel; The grayscale image and multi-scale mean filtering kernel are input into the multi-scale difference map generation layer. The absolute difference between the grayscale image and the mean filtering results at each scale is calculated. Weighted and normalized processing is performed on the absolute difference. The maximum value is taken for the normalized multi-scale results, and then multi-scale fusion is performed to obtain the initial difference map. The initial difference map is input into the attention generation and deep feature extraction layer to obtain the primary attention map. High-level semantic features are extracted, and the primary attention map and multi-layer high-level feature maps are output. The initial difference map, the primary attention map, and the multi-layer high-level feature maps are input into the adaptive residual fusion and final attention output layer to perform residual fusion and feature integration to obtain the refined attention map. S22: Input the fused and enhanced feature map into the channel message passing module to obtain a refined feature map; the channel message passing module includes a global average pooling layer, a channel partitioning layer, a linear mapping layer, an attention weight calculation and normalization layer, an attention message passing layer, and a scaling factor generation and feature calibration layer; S23: Input the refined feature map into the spatial channel collaboration module to obtain a collaboratively fused feature map; the spatial channel collaboration module includes a convolutional projection spatial attention generation layer, a feature aggregation channel response generation layer, and an outer product fusion residual connection layer; S24: Input the collaborative fusion feature map and the refined attention map into the shore-based enhancement FPN module to obtain a multi-scale enhanced feature map. Input the multi-scale enhanced feature map into the detection head to obtain the ship target classification result. The shore-based enhancement FPN module includes a lateral convolution feature construction layer, a selective shore-based attention enhancement layer, and a top-down pyramid fusion layer. S241: Input the collaboratively fused feature map into the lateral convolutional feature construction layer, perform channel dimension alignment and feature regularization to obtain the lateral feature map; S242: Input the lateral feature map and the refined attention map into the selective shoreline attention enhancement layer to obtain the attention-enhanced low-level lateral feature map and the unenhanced high-level lateral feature map. The specific process is as follows: First, the refined attention map is scaled to the spatial size of the corresponding lateral feature map through bilinear interpolation to ensure dimension matching. Based on the preset index set, element-wise multiplication of the refined attention map and the lateral feature map is performed only on the low-level lateral feature map, while the high-level feature map is not processed to obtain the attention-enhanced low-level lateral feature map and the unenhanced high-level lateral feature map. S243: Input the low-level lateral feature maps and high-level lateral feature maps into the top-down pyramid fusion layer to obtain multi-scale enhanced feature maps. The specific process is as follows: The high-level lateral feature map is upsampled by bilinear interpolation with a multiplier of 2. The upsampled high-level lateral feature map is then fused element by element with the adjacent low-level lateral feature map. This process completes multi-scale feature completion and semantic transfer from top to bottom, resulting in a multi-scale enhanced feature map. S25: Input the preprocessed SAR image into the SAR image ship detection model to calculate the loss function value, and perform backpropagation to obtain the optimized SAR image ship detection model; S3: After preprocessing the SAR image to be tested, input it into the optimized SAR image ship detection model to obtain the ship target classification result.

2. The SAR image ship detection method based on channel decoupling collaboration and shoreline prior as described in claim 1, characterized in that, In step S21, the preprocessed SAR image input channel is decoupled and fused to obtain a fused enhanced feature map. The specific process is as follows: The preprocessed SAR image is input into the channel segmentation layer for proportional segmentation to obtain the backbone feature map and auxiliary feature map. The backbone feature map and auxiliary feature map are input into the differential convolution processing layer to perform convolution nonlinear transformation on the backbone feature map and directly retain the auxiliary feature map to obtain the high-level backbone feature map and auxiliary feature map. The high-level feature map and auxiliary feature map are input into the channel stitching activation layer for channel dimension stitching and nonlinear activation to obtain the single-branch fusion feature map. The preprocessed SAR image is input into the channel weight generation layer, where channel average pooling and mapping are performed to obtain the channel fusion weights. The single-branch fusion feature map and the channel fusion weights are input into the weighted residual fusion layer, and then multiplied and weighted by channel-by-channel and connected to the residuals to obtain the fusion enhanced feature map.

3. The SAR image ship detection method based on channel decoupling collaboration and shoreline prior as described in claim 1, characterized in that, In step S22, the refined feature map is obtained by inputting the fused and enhanced feature map into the message passing module of the channel. The specific process is as follows: S221: Input the fused and enhanced feature map into the global average pooling layer to perform global average pooling to obtain the channel description vector, as shown in the following formula: , , in, Indicates the first The sample, the first Channel-level response values ​​for each channel. This indicates the sequence number of the current sample within the batch. Indicates the first One channel, Indicates the height of the spatial dimension. Indicates the width of the spatial dimension. Indicates the summation index in the height direction. Indicates the summation index in the width direction. This indicates that the fused enhanced feature map contains four dimensions: batch, channel, height, and width. Represents all channel-level response values The channel description vector is composed of Represents the space of real numbers. This indicates the number of samples input into the network at one time. Indicates the number of channels; S222: Input the channel description vector into the channel partitioning layer and proportionally divide it to obtain the teacher channel and the student channel. The specific process is as follows: Using the channel description vector as the processing object, the vector is divided along the channel dimension, with the first part of the vector being the teacher channel and the remaining channels being the student channel; S223: The student input linear mapping layer performs linear mapping to obtain the query matrix; the teacher input linear mapping layer performs linear mapping to obtain the value matrix and key matrix, as shown in the following formula: , , , in, Represents the query matrix. Represents the key matrix, Represents a value matrix, This represents the student channel description matrix. This represents the teacher channel description matrix. This represents the learned projection weight matrix of the query matrix. The learned projection weight matrix represents the key matrix. The learning projection weight matrix represents the value matrix. Indicates the number of teacher access channels. Indicates the number of student access channels. Indicates the projection dimension; S224: Input the query matrix and key matrix into the attention weight calculation and normalization layer to calculate the channel attention weights and then normalize them to obtain the attention weight matrix, as shown in the following formula: , in, Represents the attention weight matrix. express The transpose of the matrix, Indicates the projection dimension; S225: Input the attention weight matrix and value matrix into the attention message passing layer to perform cross-channel message passing from the teacher channel to the student channel, and obtain the attention feature matrix, as shown in the following formula: , in, Represents the attention feature matrix, Represents a value matrix; S226: Input the attention feature matrix into the scaling factor generation and feature calibration layer, perform a linear mapping transformation, generate adaptive channel scaling factors through Sigmoid activation, and use the scaling factors to calibrate the weights of the student channels to obtain a refined feature map, as shown in the following formula: , , , in, The scaling factor tensor of the student channel. This represents the activation function. Represents the linear mapping weight matrix. Represents a refined feature map. This represents the fusion-enhanced feature map. This indicates that the teacher channel's characteristics will be retained in their original values ​​without any modification. For each channel representing a student channel, all pixels at all spatial locations are multiplied by the scaling factor corresponding to that channel.

4. The SAR image ship detection method based on channel decoupling collaboration and shoreline prior as described in claim 1, characterized in that, In step S23, the refined feature map is input into the spatial channel collaboration module to obtain the collaborative fusion feature map. The specific process is as follows: S231: Input the refined feature map into the convolutional projection spatial attention generation layer to obtain a projection feature map and a spatial attention map of the same dimension. The specific process is as follows: By projecting the refined feature map into features of a uniform dimension through convolution operations, a same-dimensional projected feature map is obtained. Then, another convolution in the spatial aggregation branch is used to perform spatial dimension processing on the refined feature map. After normalization, the spatial attention map is obtained, as shown in the following formula: , in, Representing a spatial attention map, Represents the normalization function. Learning convolutional kernels representing spatial attention, Represents a refined feature map. Represents the number of spatial locations. Indicates the height of the spatial dimension. Indicates the width of a spatial dimension; S232: Input the same-dimensional projected feature map and spatial attention map into the feature aggregation channel response generation layer to obtain the channel response feature map. The specific process is as follows: The same-dimensional projection feature map and the spatial attention map are multiplied by matrix to complete the spatial dimension feature aggregation, resulting in a spatial aggregated feature map. The refined feature map is then weighted using the spatial attention map and summed along the spatial dimension to obtain the channel-level response. The channel-level response is then dimensionally reshaped and multiplied by matrix with the spatial aggregated feature map to obtain the channel response feature map. S233: Input the channel response feature map into the outer product fusion residual connection layer to obtain the co-fusion feature map. The specific process is as follows: The fused feature map is obtained by taking the outer product of the spatial aggregation feature map and the channel response feature map. After reshaping the dimensions, the fused feature map is obtained by adding the residuals of the fused feature map and the refined feature map. The formula is as follows: , , in, Represents the fused feature map. Represents spatial aggregation feature map, This represents the channel response feature map. This represents element-wise multiplication. This indicates a reshaping operation. Represents the collaborative fusion feature map. This indicates a residual connection.

Citation Information

Patent Citations

  • Multi-modal image segmentation method based on cross attention

    CN117911426A

  • Vehicle intelligent safety cab system based on multi-mode perception and intelligent decision

    CN121893892A