SAR image ship target detection method, device, electronic equipment and storage medium

By using deformable convolutional networks and cascaded cross-shaped attention mechanisms in ship target detection in SAR images, the problems of scattering point discontinuity and receptive field limitations are solved, and more accurate and efficient ship target detection is achieved.

CN118397257BActive Publication Date: 2024-09-27WUHAN ZHUOMU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410859418.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-27
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Due to the discontinuity of scattering points and the limitation of the receptive field of the convolutional neural network, the existing ship target detection methods in SAR images result in incomplete ship target detection and high false detection rate, making it difficult to capture global structural information.

Method used

The deformable convolutional network and cascaded cross-shaped attention mechanism are used to predict the offset of the convolution kernel and adjust the receptive field through strong scattering points, combined with the anchor-free target detection model, to perform global feature extraction and target detection.

Benefits of technology

It improves the accuracy and completeness of ship target detection, reduces the false detection rate, and reduces the amount of calculation and memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397257B
    Figure CN118397257B
Patent Text Reader

Abstract

The present invention provides a method, device, electronic device and storage medium for detecting ship targets in SAR images, which relate to the technical field of computer vision. The method inputs the initial feature map and the strong scattering points in the ship target area into a deformable convolutional network. Through the deformable convolutional network, the receptive field can be automatically adjusted according to the distribution of the strong scattering points in the ship target area in the SAR image to be detected. By adapting to the irregular geometric changes of the ship target, the area with high scattering intensity can be responded to during the target detection process. The physical structure of the ship target is also considered, and the key features of the ship target can be accurately captured. The introduction of the cascaded cross attention mechanism can enhance the interaction between the strong scattering points in the ship target area by reducing the number of feature channels and using the cross to calculate the local correlation, which can effectively transmit global information, improve the comprehensiveness of feature representation and the accuracy of target detection, and greatly reduce the amount of calculation and video memory usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a SAR image ship target detection method, device, electronic equipment and storage medium. Background Art

[0002] With the rapid development of the global digital information age, remote sensing technology plays an increasingly important role in military, civilian and other fields. Synthetic Aperture Radar (SAR), as a type of remote sensing technology, has shown unique advantages in various fields with its all-weather and all-day monitoring capabilities. Therefore, it is crucial to improve the performance of ship target detection in SAR images.

[0003] Existing ship target detection methods in SAR images are usually implemented based on deep learning detectors, which can obtain high-precision ship target detection results. However, since a single ship target in a SAR image appears as a discrete or isolated set of strong backscattering points. The discontinuity of the scattering points easily leads to multiple separate detection results for one ship target, which poses a great challenge to the integrity of ship target detection. Moreover, the strong scattering points of buildings around the ship target are easily confused with the parts of the ship target, resulting in inaccurate positioning of the ship target.

[0004] In addition, due to the characteristics of stacked convolutional layers in the convolutional neural network used by the detector, the receptive field of image features is limited, making the convolutional neural network less capable of capturing image context information. This results in only local information of ship targets being available in SAR images, while global structural information is easily ignored. Since offshore ship targets are detected with scattering similar to that of complex land areas such as port facilities and buildings, a large number of false detections occur in ship target detection. Summary of the invention

[0005] The present invention provides a SAR image ship target detection method, device, electronic equipment and storage medium, which are used to solve the defects in the prior art.

[0006] The present invention provides a SAR image ship target detection method, comprising:

[0007] Acquire the SAR image to be detected;

[0008] Performing feature extraction on the SAR image to be detected to obtain an initial feature map of the SAR image to be detected, and determining strong scattering points in the ship target area in the SAR image to be detected;

[0009] The initial feature map and the strong scattering points of the ship target area are input into a deformable convolutional network, wherein the deformable convolutional network is used to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, apply the offset to update the sampling position to obtain an updated position, and obtain and output a scattering point embedding feature map corresponding to the initial feature map based on the updated position;

[0010] Based on the cascade cross attention mechanism, feature extraction is performed on the scattering point embedded feature map to obtain a global feature map, and based on the global feature map, the ship target in the SAR image to be detected is detected.

[0011] According to a SAR image ship target detection method provided by the present invention, the deformable convolutional network is optimized based on the offset loss;

[0012] The offset loss is calculated based on the following steps:

[0013] Inputting the initial feature map samples of the SAR image samples and the strong scattering points of the ship target sample area in the SAR image samples into the initial convolution network, wherein the initial convolution network is used to predict the offset samples of each sampling position of the convolution kernel based on the strong scattering points of the ship target sample area;

[0014] Based on the actual offset of each sampling position of the convolution kernel in the initial feature map sample and the offset sample, a smooth L1 loss function is applied to calculate the offset loss.

[0015] According to a SAR image ship target detection method provided by the present invention, the ship target in the to-be-detected SAR image is detected based on the global feature map, comprising:

[0016] The global feature map is input into an anchor-free target detection model; the anchor-free target detection model is used to calculate a regression prediction vector at each feature point of the global feature map, and based on the target mapping points of each feature point in the global feature map in the SAR image to be detected, and the distance information corresponding to the target mapping points in the regression prediction vector, calculate the position information of the target detection frame of the ship target.

[0017] According to a SAR image ship target detection method provided by the present invention, the anchor-free target detection model is trained based on the following steps:

[0018] Inputting a global feature map sample of the SAR image sample into an initial target detection model, and calculating a regression prediction vector sample at each feature point of the global feature map sample by the initial target detection model;

[0019] For any feature point in the global feature map sample, determine a mapping point sample of the any feature point in the SAR image sample, and if the mapping point sample is located in a marked box of a ship target sample in the SAR image sample, determine the mapping point sample as an initial positive sample point;

[0020] Based on the initial positive sample points and the regression prediction vector samples, the initial object detection model is trained to obtain the anchor-free object detection model.

[0021] According to a SAR image ship target detection method provided by the present invention, the annotation box includes a horizontal annotation box and a rotation annotation box; accordingly, the initial target detection model is trained based on the initial positive sample points and the regression prediction vector samples to obtain the anchor-free target detection model, including:

[0022] Calculate first position information and first area information of the horizontal detection frame based on the initial positive sample point and first distance information from the initial positive sample point to the horizontal detection frame in the regression prediction vector sample;

[0023] Based on the first position information, calculating second position information and second area information of the rotation detection frame where the initial positive sample point is located;

[0024] Determine a detection frame rotation factor of the initial positive sample point based on the first area information and the second area information, and determine a regression target of the initial positive sample point based on the detection frame rotation factor or based on a size relationship between the first area information and the second area information;

[0025] Based on the initial positive sample points and their regression targets and the regression prediction vector samples, the rotation factor loss is applied to train the initial target detection model to obtain the anchor-free target detection model;

[0026] The rotation factor loss is determined based on the detection frame rotation factor and the annotation frame rotation factor, and the annotation frame rotation factor is determined based on the horizontal annotation frame and the rotation annotation frame.

[0027] According to a SAR image ship target detection method provided by the present invention, the step of determining strong scattering points in the ship target area in the SAR image to be detected comprises:

[0028] Based on the principal component analysis method, determining the principal axis of the ship target in the ship target area, and calculating the normalized distance from each pixel point in the ship target area to the principal axis;

[0029] Based on the kernel density estimation method, the kernel density value of each pixel point in the ship target area is calculated, and based on the normalized distance corresponding to each pixel point in the ship target area and the kernel density value, the confidence of each pixel point in the ship target area as a strong scattering point is calculated;

[0030] Based on the confidence level corresponding to each pixel point in the ship target area, a strong scattering point in the ship target area is determined.

[0031] According to a SAR image ship target detection method provided by the present invention, the deformable convolutional network is specifically used for:

[0032] Based on a bilinear interpolation method, the feature values ​​of feature points around the update position in the initial feature map are applied to calculate the feature value at the update position in the initial feature map.

[0033] The present invention also provides a SAR image ship target detection device, comprising:

[0034] An image acquisition module is used to acquire the SAR image to be detected;

[0035] A feature extraction module is used to extract features from the SAR image to be detected, obtain an initial feature map of the SAR image to be detected, and determine strong scattering points in the ship target area in the SAR image to be detected;

[0036] a scattering point embedding module, configured to input the initial feature map and the strong scattering points of the ship target area into a deformable convolutional network, wherein the deformable convolutional network is configured to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, apply the offset to update the sampling position to obtain an updated position, and obtain and output a scattering point embedding feature map corresponding to the initial feature map based on the updated position;

[0037] The target detection module is used to extract features from the scattering point embedded feature map based on a cascaded cross attention mechanism to obtain a global feature map, and detect the ship target in the SAR image to be detected based on the global feature map.

[0038] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned methods for detecting ship targets in SAR images is implemented.

[0039] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for detecting ship targets in SAR images as described in any one of the above is implemented.

[0040] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for detecting ship targets in SAR images.

[0041] The SAR image ship target detection method, device, electronic device and storage medium provided by the present invention input the initial feature map and the strong scattering points of the ship target area into the deformable convolutional network. Through the deformable convolutional network, the receptive field can be automatically adjusted according to the distribution of the strong scattering points of the ship target area in the SAR image to be detected. By adapting to the irregular geometric changes of the ship target, in the target detection process, not only can the area with high scattering intensity be responded to, but also the physical structure of the ship target is considered, and the key features of the ship target can be accurately captured. Moreover, the introduction of the cascaded cross attention mechanism, by reducing the number of feature channels and using the cross to calculate local correlation, not only enhances the interaction between the strong scattering points in the ship target area, but also can effectively transmit global information, improve the comprehensiveness of feature representation and the accuracy of target detection, and can also greatly reduce the amount of calculation and video memory usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 This is one of the flow charts of the SAR image ship target detection method provided by the present invention.

[0044] Figure 2 This is the second flow chart of the SAR image ship target detection method provided by the present invention.

[0045] Figure 3 It is a structural schematic diagram of the SAR image ship target detection device provided by the present invention.

[0046] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] The existing SAR image ship target detection method implemented by the deep learning-based detector will result in multiple separate detection results for one ship target due to the discontinuity of the scattering points of a single ship target in the SAR image, which will lead to incomplete ship target detection. Moreover, the strong scattering points of the buildings around the ship target are easily confused with the parts of the ship target, resulting in inaccurate positioning of the ship target. In addition, due to the stacked structure of the convolutional layers in the detector, the receptive field of the image features will be limited, so that only local information of the ship target in the SAR image is available, while the global structural information is easily ignored, which leads to a large number of false detections in ship target detection.

[0049] Based on this, an embodiment of the present invention provides a method for detecting ship targets in SAR images.

[0050] Figure 1 FIG. 1 is a flow chart of a method for detecting ship targets in a SAR image provided in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0051] S1, obtaining the SAR image to be detected;

[0052] S2, extracting features from the SAR image to be detected to obtain an initial feature map of the SAR image to be detected, and determining strong scattering points in the ship target area in the SAR image to be detected;

[0053] S3, inputting the initial feature map and the strong scattering points of the ship target area into a deformable convolutional network, wherein the deformable convolutional network is used to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, applying the offset to update the sampling position to obtain an updated position, and obtaining and outputting a scattering point embedding feature map corresponding to the initial feature map based on the updated position;

[0054] S4, based on the cascade cross attention mechanism, feature extraction is performed on the scattering point embedded feature map to obtain a global feature map, and based on the global feature map, the ship target in the SAR image to be detected is detected.

[0055] Specifically, the SAR image ship target detection method provided in the embodiment of the present invention is executed by a SAR image ship target detection device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, a tablet, etc., which is not specifically limited here.

[0056] First, step S1 is performed to obtain a SAR image to be detected. The SAR image to be detected is an image acquired by SAR. The SAR image to be detected may contain one or more ship targets, which is determined by actual conditions. The width of the SAR image to be detected may be W, and the height may be H.

[0057] The SAR image ship target detection device can be connected to the SAR, and the SAR can transmit the collected SAR image to be detected to the SAR image ship target detection device.

[0058] Then, step S2 is performed, and the feature extraction network can be used to extract features from the SAR image to be detected, and an initial feature map of the SAR image to be detected can be obtained. Based on different structures of the feature extraction network, one or more initial feature maps of different scales of the SAR image to be detected can be obtained. For example, the feature extraction network can be a feature pyramid network (FPN), and the FPN includes multiple feature extraction layers of different scales. Then, by extracting features from the SAR image to be detected through the feature extraction layers of each scale, feature maps of multiple scales can be obtained, and feature maps of different scales are used to detect ship targets of different sizes.

[0059] Different scales of feature extraction layers in FPN correspond to different downsampling ratios to adapt to the diversity of ship target sizes. For example, the downsampling ratio of FPN at the kth feature extraction layer can be expressed as: , the obtained feature map can be expressed as , the width of the feature map is , the height of the feature map is , the original number of channels of the feature map is C. Among them, k can be set as needed, for example, it can be 3, 4, 5, 6, 7.

[0060] While extracting features, the ship target area in the to-be-detected SAR image can also be extracted to determine the strong scattering points in the ship target area. The strong scattering points in the ship target area may include one or more, and multiple strong scattering points may constitute a strong scattering point set.

[0061] Here, the amplitude matrix of the ship target area can be determined, and the amplitude matrix includes the pixel value of each pixel point in the ship target area. Then, the amplitude matrix is ​​traversed to determine the size of each pixel value in the amplitude matrix and the detection threshold. If a pixel value in the amplitude matrix is ​​greater than the detection threshold, the corresponding pixel point is determined to be a strong scattering point.

[0062] Thereafter, step S3 is executed to introduce a deformable convolutional network, and to introduce an offset guided by a strong scattering point for each sampling position of the convolution kernel. The offset of each sampling position is combined with the original convolution operation of the convolution kernel. The initial feature map is extracted by the convolution kernel to obtain a scattering point embedding feature map, thereby realizing the key point saliency embedding operation.

[0063] Here, the initial feature map and the strong scattering points of the ship target area can be input into the deformable convolution network, and the deformable convolution network can predict the offset of each sampling position of the convolution kernel according to the strong scattering points of the ship target area. The sampling area K on the initial feature map can be set first, and the sampling area includes the sampling positions of the convolution kernel. , the sampling position can be from the sampling point of the initial feature map, that is, the core of the convolution kernel , diffused to the surrounding. For example, if the size of the convolution kernel is 3×3, then there are 9 sampling positions, and the 9 sampling positions can constitute a sampling position set, which can be expressed as , where for any sampling position (x, y), x=1 represents the right side of the sampling point, x=0 represents the same as the horizontal coordinate of the sampling point, x=-1 represents the left side of the sampling point, y=1 represents the upper side of the sampling point, y=0 represents the same as the vertical coordinate of the sampling point, and y=-1 represents the lower side of the sampling point. For example, (-1,0) represents the position on the left side of the sampling point, (0,1) represents the position on the right side of the sampling point, and (1,1) represents the position on the lower right corner of the sampling point, and so on.

[0064] The offset of each sampling position can be expressed as , apply the offset For sampling position Update and get the updated position . Thus, the original convolution operation of the convolution kernel can be adjusted according to the update position:

[0065]

[0066] in, For the convolution kernel in the core The result of the operation at that time is that the scattering points corresponding to the initial feature map are embedded in the core of the feature map The eigenvalue at , W is the weight matrix of the convolution kernel, The sampling position The sampling weight at Update the feature value at position in the initial feature map.

[0067] Finally, step S4 is performed, and a cascaded cross-shaped attention mechanism is used to extract features from the scattered point embedded feature map to obtain a global feature map. The cascaded cross-shaped attention mechanism can be implemented by two consecutive cross-shaped attention structures, one cross-shaped attention structure starts from the first feature point of the scattered point embedded feature map, extracts features in the horizontal direction and the vertical direction respectively, and establishes an association relationship between the first feature point and the adjacent feature points in the horizontal direction and the vertical direction, and the other cross-shaped attention structure starts from the adjacent feature points in the horizontal direction and the vertical direction respectively, extracts features in the vertical direction and the horizontal direction respectively, and establishes an association relationship between the two adjacent feature points and the second feature point, and then associates the first feature point with the second feature point, and finally obtains a global feature map.

[0068] The specific calculation process of each cross-shaped attention structure can include:

[0069] Three 1×1 convolution operations are performed on the input feature map H to generate feature matrices Q, K, and V, where the feature matrices Q and K are used for attention score calculation, and the feature matrix V is used to generate the final global feature map.

[0070] Through the convolution operation, the number of channels of the feature matrices Q and K is reduced from the original number of channels C to C', where C' is much smaller than the original number of channels C, so as to reduce the amount of calculation and video memory requirements.

[0071] Define each pixel The eigenvectors in the feature matrix Q are , the cross-shaped neighborhood feature vector set in the feature matrix K is ,in .

[0072] right and Perform a dot product operation on all elements in to generate a relevance score vector with a dimension of W+H-1 , the dot multiplication operation is repeated for each pixel in the input feature map to obtain the correlation score map .

[0073] Pair Correlation Score Plot Each relevance score vector Perform Softmax normalization to obtain a normalized weight vector , the normalized weight vector Represents the correlation weight of the pixel point and each point in its cross-shaped neighborhood, that is:

[0074]

[0075] Among them, j is the pixel point in all cross-shaped neighborhoods.

[0076] For each channel's feature matrix V, the feature map plane spatial position and the vector composed of the eigenvalues ​​of the pixel positions in the same row and column ,use Perform a weighted sum and add the value of the corresponding position in the input feature map to update the feature vector at that position.

[0077] where, for each channel c in the feature vector V, the vector Included The eigenvalues ​​of the pixels in the same row and column as the channel of the feature matrix are:

[0078]

[0079] Among them, each element Indicates that the feature vector V is in channel c, The eigenvalue of the j-th pixel in the cross neighborhood of the position.

[0080] Then, the normalized weight vector The corresponding vector Perform dot multiplication, accumulate all channels, and then add the input feature map The feature vector of the position , and get the updated feature vector , that is:

[0081] .

[0082] Repeat the above operation to update the original feature map H and generate a new feature map H', whose size is .

[0083] Using two consecutive cross-shaped attention structures, we can transfer information from different local cross-shaped regions, and then transfer global information to obtain a global feature map. In general, by using two consecutive cross-shaped attention structures, the amount of computation can be reduced from the original (H×W) 2 The time is reduced to (H×W)×(H×W-1).

[0084] Afterwards, the global feature map can be input into the target detection model to detect the ship target in the SAR image to be detected, and obtain the ship target detection result. The target detection model can be a prediction model without anchor boxes or a prediction model with anchor boxes, which is not specifically limited here.

[0085] The SAR image ship target detection method provided in the embodiment of the present invention first obtains the SAR image to be detected; then extracts features from the SAR image to be detected to obtain the initial feature map of the SAR image to be detected, and determines the strong scattering points of the ship target area in the SAR image to be detected; thereafter, the initial feature map and the strong scattering points of the ship target area are input into the deformable convolutional network, and the receptive field can be automatically adjusted according to the distribution of the strong scattering points in the ship target area in the SAR image to be detected through the deformable convolutional network. By adapting to the irregular geometric changes of the ship target, in the target detection process, not only can the area with high scattering intensity be responded to, but also the physical structure of the ship target is considered, and the key features of the ship target can be accurately captured. Moreover, the introduction of the cascaded cross attention mechanism, by reducing the number of feature channels and using the cross to calculate local correlation, not only enhances the interaction between the strong scattering points in the ship target area, but also effectively transmits global information, improves the comprehensiveness of feature representation and the accuracy of target detection, and can also greatly reduce the amount of calculation and video memory usage.

[0086] Based on the above embodiment, the deformable convolutional network is optimized based on the offset loss; wherein the offset loss is calculated based on the following steps:

[0087] Inputting the initial feature map samples of the SAR image samples and the strong scattering points of the ship target sample area in the SAR image samples into the initial convolution network, wherein the initial convolution network is used to predict the offset samples of each sampling position of the convolution kernel based on the strong scattering points of the ship target sample area;

[0088] Based on the actual offset of each sampling position of the convolution kernel in the initial feature map sample and the offset sample, a smooth L1 loss function is applied to calculate the offset loss.

[0089] Specifically, the deformable convolutional network can be optimized by the offset loss, which can optimize the difference between the predicted offset and the true offset, ensuring that the deformable convolutional network can learn the offset associated with the strong scattering points, and then accurately simulate the scattering characteristics of the ship target in the SAR image to be detected.

[0090] The offset loss can be calculated based on the following steps:

[0091] The initial feature map samples of the SAR image samples and the strong scattering points of the ship target sample area in the SAR image samples are input into the initial convolution network. The initial convolution network predicts the offset samples of each sampling position of the convolution kernel based on the strong scattering points of the ship target sample area. .

[0092] Afterwards, the actual offset of each sampling position of the convolution kernel in the initial feature map sample is used Sample with offset , apply the smooth L1 loss function and calculate the offset loss . That is:

[0093]

[0094] Where N is the number of SAR image samples.

[0095] Based on the above embodiment, the deformable convolutional network is specifically used for:

[0096] Based on a bilinear interpolation method, the feature values ​​of feature points around the update position in the initial feature map are applied to calculate the feature value at the update position in the initial feature map.

[0097] Specifically, in order to enable the deformable convolutional network to handle the situation where the update position may be non-integer, the bilinear interpolation method is used to accurately calculate the update position to ensure that the convolution operation can be accurately performed on the actual image coordinates. For each update position p, calculate:

[0098]

[0099] in, is a two-dimensional bilinear interpolation function, where q is the surrounding pixel point centered on p.

[0100] Classical object detection methods based on deep learning all rely on anchor box technology to identify and locate objects in images through preset anchor boxes. However, this method has obvious limitations: the increased number of anchor boxes and the matching process reduce the efficiency of the algorithm.

[0101] To this end, on the basis of the above embodiment, the detecting of the ship target in the to-be-detected SAR image based on the global feature map includes:

[0102] The global feature map is input into an anchor-free target detection model; the anchor-free target detection model is used to calculate a regression prediction vector at each feature point of the global feature map, and based on the target mapping points of each feature point in the global feature map in the SAR image to be detected, and the distance information corresponding to the target mapping points in the regression prediction vector, calculate the position information of the target detection frame of the ship target.

[0103] Specifically, when detecting the ship target in the SAR image to be detected, the anchor-free target detection model can be introduced, the global feature map is input into the anchor-free target detection model, and the regression prediction vector is calculated at each feature point of the global feature map by the anchor-free target detection model, and the regression prediction vector can include the distance information between the target mapping point of each feature point in the SAR image to be detected and the target detection frame of the ship target. The distance information can include the distance between the target mapping point and the four frame edges of the horizontal detection frame, and the offset between the hypotenuse vertex of the target detection frame and the hypotenuse vertex of the horizontal detection frame.

[0104] Combining the target mapping points of each feature point in the global feature map in the SAR image to be detected and the distance information corresponding to the target mapping point in the regression prediction vector, the position information of the target detection box of the ship target can be calculated. For example, the target mapping point is , the distance between the target mapping point and the four box edges of the horizontal detection box can be expressed as: , l is the distance between the target mapping point and the left edge of the horizontal detection box, t is the distance between the target mapping point and the upper edge of the horizontal detection box, r is the distance between the target mapping point and the right edge of the horizontal detection box, and b is the distance between the target mapping point and the lower edge of the horizontal detection box.

[0105] The position of the diagonal point of the horizontal detection box can be expressed as:

[0106]

[0107] in, is the position information of the upper left vertex of the horizontal detection box, It is the position information of the lower right vertex of the horizontal detection box.

[0108] The position of the target detection box of the ship target can be calculated by combining the offset between the hypotenuse vertex of the target detection box and the hypotenuse vertex of the horizontal detection box in the regression prediction vector and the position of the diagonal point of the horizontal detection box.

[0109] Based on the above embodiment, the anchor-free object detection model is trained based on the following steps:

[0110] Inputting a global feature map sample of the SAR image sample into an initial target detection model, and calculating a regression prediction vector sample at each feature point of the global feature map sample by the initial target detection model;

[0111] For any feature point in the global feature map sample, determine a mapping point sample of the any feature point in the SAR image sample, and if the mapping point sample is located in a marked box of a ship target sample in the SAR image sample, determine the mapping point sample as an initial positive sample point;

[0112] Based on the initial positive sample points and the regression prediction vector samples, the initial object detection model is trained to obtain the anchor-free object detection model.

[0113] Specifically, in the process of training to obtain the anchor-free target detection model, SAR image samples may be obtained first, and the SAR image samples may include multiple SAR image samples, and the multiple SAR image samples may constitute a SAR image sample set for training the initial target detection model. Here, each SAR image sample may be taken from a SAR dataset, and the SAR dataset may include an SSDD SAR dataset and / or an HRSID dataset. Each SAR image sample may include one or more ship target samples, and each ship target sample in each SAR image sample carries a labeling box.

[0114] In an embodiment of the present invention, the ship target samples in the SAR image sample set can be divided into a training set and a test set according to a preset ratio. The training set is used to train the initial target detection model, and the test set is used to test the trained model. If the test passes, the trained model is used as the anchor-free target detection model. If the test fails, the trained model continues to be trained until the test passes.

[0115] The preset ratio can be set as needed, for example, it can be 7:3, or other ratios, which are not specifically limited here.

[0116] Afterwards, the global feature map samples of the SAR image samples can be input into the initial target detection model, and the initial target detection model implements the anchor-free box prediction strategy and adopts the pixel-by-pixel regression strategy to calculate the center degree and regression prediction vector samples at each feature point of the global feature map samples.

[0117] Then, for any feature point (x, y) in the global feature map sample, determine the mapping point sample of any feature point (x, y) in the SAR image sample , and there are:

[0118]

[0119] Among them, s is the downsampling step size of the initial target detection model.

[0120] If the mapping point sample If the sample is located in the annotation box of the ship target sample in the SAR image sample, the mapping point sample is determined to be the initial positive sample point, and the category of the initial positive sample point can be determined to be the category of the annotation box. The other pixel points in the SAR image sample except the mapping point sample are the initial negative sample points.

[0121] After that, the initial target detection model is trained using the initial positive sample points, initial negative sample points, and regression prediction vector samples, combined with classification loss and regression loss, to obtain an anchor-free target detection model. Among them, the classification loss can be calculated by the categories of the initial positive sample points and the initial negative sample points, and the regression loss can be calculated by the center point and the regression prediction vector samples.

[0122] Traditional ship detection methods and deep learning-based methods mostly use horizontal bounding boxes, which cannot adapt well to the narrow and long ship shape and have difficulty reflecting the direction information of the ship. Since the ship may dock at any angle, the horizontal detection box will inevitably contain some redundant background. In contrast, the directional bounding box can focus more on the ship rather than the background.

[0123] Based on the above embodiment, the annotation box includes a horizontal annotation box and a rotation annotation box;

[0124] Furthermore, when training the initial target detection model, the first position information and the first area information of the horizontal detection frame are calculated using the initial positive sample points and the first distance information from the initial positive sample points to the horizontal detection frame in the regression prediction vector sample. The second position information and the second area information from the initial positive sample points to the rotation detection frame are calculated using the first position information.

[0125] Thereafter, the first area information and the second area information are used to calculate the detection frame rotation factor of the initial positive sample point using the following formula:

[0126]

[0127] in, is the detection frame rotation factor, O is the rotated detection frame, B is the horizontal detection frame, area(O) is the second area information, and area(B) is the first area information.

[0128] Thereafter, the detection frame rotation factor can be used to determine the regression target of the initial positive sample point. The regression target is the prediction result corresponding to the initial positive sample point. Here, the detection frame rotation factor can be compared with the factor threshold. If the detection frame rotation factor is greater than the factor threshold, the regression target can be determined to be a horizontal detection frame. If the detection frame rotation factor is less than or equal to the factor threshold, the regression target can be determined to be a rotated detection frame. This can eliminate the prediction inaccuracy caused by small angle tilts close to the horizontal direction. Among them, the factor threshold can be set as needed, for example, it can be set to 0.95, or it can be set to other values, which are not specifically limited here.

[0129] In addition, when the rotation detection frame and the horizontal detection frame overlap, the size relationship between the first area information and the second area information can be used to determine the regression target of the initial positive sample point. For example, the smaller area of ​​the horizontal detection frame and the rotation detection frame can be selected as the regression target to enhance the accuracy and reliability of target detection.

[0130] After that, for the initial positive sample points, the initial positive sample points can also be screened according to the distance from the initial positive sample points to the edges of the regression target, and according to the distance and the maximum regression distance of each feature extraction layer in the feature extraction network. For example, the distance from the initial positive sample points to the edges of the regression target can be expressed as , is the distance between the initial positive sample point and the left box edge of the regression target, is the distance between the initial positive sample point and the upper frame edge of the regression target, is the distance between the initial positive sample point and the right box edge of the regression target, is the distance between the initial positive sample point and the lower frame edge of the regression target. The maximum regression distance of the second feature extraction layer in the feature extraction network can be 0, the maximum regression distance of the third feature extraction layer can be 64, the maximum regression distance of the fourth feature extraction layer can be 128, the maximum regression distance of the fifth feature extraction layer can be 256, the maximum regression distance of the sixth feature extraction layer can be 512, and the maximum regression distance of the seventh feature extraction layer can be infinite.

[0131] Determine the maximum value in this distance , and judge whether the maximum value is within the distance range formed by the maximum regression distance between the feature extraction layer of the feature point corresponding to the initial positive sample point and the previous feature extraction layer, so as to judge whether the initial positive sample point belongs to the prediction range of the feature extraction layer of the feature point corresponding to the initial positive sample point. If the maximum value is within the distance range, it means that the initial positive sample point belongs to the prediction range of the feature extraction layer of the feature point corresponding to the initial positive sample point, and the initial positive sample point is determined to be a positive sample point. Otherwise, if the maximum value is not within the distance range, it means that the initial positive sample point does not belong to the prediction range of the feature extraction layer of the feature point corresponding to the initial positive sample point, and the initial positive sample point is determined to be a negative sample.

[0132] After that, the positive sample points, negative sample points and regression prediction vector samples can be used to apply the rotation factor loss to train the initial target detection model to obtain the anchor-free target detection model.

[0133] The rotation factor loss can be determined by using the detection box rotation factor and the annotation box rotation factor, and the annotation box rotation factor is determined based on the horizontal annotation box and the rotated annotation box. The annotation box rotation factor can be the area ratio of the rotated annotation box to the horizontal annotation box.

[0134] The rotation factor loss can be expressed as:

[0135]

[0136] in, is the rotation factor loss, is the detection box rotation factor, is the annotation box rotation factor.

[0137] When training the initial object detection model, the total loss L used can include the classification loss , center loss , position regression loss And the rotation factor loss , that is:

[0138] .

[0139] The classification loss can be calculated based on the category of each sample point, the center loss can be calculated based on the center of each sample point in the regression prediction vector sample, and the position regression loss can be calculated based on the position in the regression prediction vector sample.

[0140] On the basis of the above embodiment, the step of determining strong scattering points in the ship target area in the to-be-detected SAR image includes:

[0141] Based on the principal component analysis method, determining the principal axis of the ship target in the ship target area, and calculating the normalized distance from each pixel point in the ship target area to the principal axis;

[0142] Based on the kernel density estimation method, the kernel density value of each pixel point in the ship target area is calculated, and based on the normalized distance corresponding to each pixel point in the ship target area and the kernel density value, the confidence of each pixel point in the ship target area as a strong scattering point is calculated;

[0143] Based on the confidence level corresponding to each pixel point in the ship target area, a strong scattering point in the ship target area is determined.

[0144] Specifically, when determining the strong scattering points in the ship target area in the SAR image to be detected, the principal component analysis (PCA) method can be used to determine the principal axis of the ship target in the ship target area. The covariance matrix of the ship target area can be calculated first, and then the eigenvector corresponding to the maximum eigenvalue of the covariance matrix is ​​extracted as the principal axis direction of the ship target, thereby determining the principal axis of the ship target.

[0145] The specific calculation process of PCA is as follows:

[0146] First, we can construct the data matrix X of each pixel point in the ship target area, where each pixel point From two-dimensional coordinates Indicates that , n is the number of pixels in the ship target area. The matrix form of X is:

[0147]

[0148] By solving the eigenvalues ​​and eigenvectors of the covariance matrix, we find the direction of the maximum variance of the data matrix X as the principal axis direction, and obtain the rotation transformation matrix U. The angle between the main axis and the horizontal direction:

[0149]

[0150] Apply the rotation transformation matrix U and calculate the new coordinate system Y=U·X:

[0151]

[0152] Among them, Y 1 Direction is the main axis, Y 2 The direction is the horizontal axis.

[0153] After that, the normalized distance from each pixel in the ship target area to the main axis is calculated , the normalized distance reflects the degree of deviation of each pixel relative to the main axis.

[0154] After that, the kernel density estimation method (KDE) is used to select a suitable kernel function and bandwidth , perform kernel density estimation on the ship target pixel set, and calculate each pixel point in the ship target area Here, the kernel function used is the Gaussian kernel function. The larger the wave width, the smoother the spatial density distribution changes. Here, the wave width can be set to 5.

[0155] After that, the normalized distance corresponding to each pixel in the ship target area is used And the kernel density value, calculate the confidence of each pixel in the ship target area as a strong scattering point , which evaluates the likelihood of each pixel in the ship target area being a strong scattering point.

[0156] Finally, the confidence corresponding to each pixel in the ship target area is used to determine the strong scattering points in the ship target area. For example, all the pixels in the ship target area are sorted according to the confidence, and the top N pixels with the highest confidence are selected as the strong scattering point candidates of the ship target.

[0157] The strong scattering point candidates are clustered and 9 strong scattering points are finally determined and output.

[0158] In summary, if Figure 2 As shown, a complete flow chart of a method for detecting ship targets in SAR images is provided in an embodiment of the present invention. The method comprises:

[0159] Acquire the SAR image to be detected;

[0160] The multi-scale initial feature map is extracted through the feature pyramid network, and the principal component analysis and kernel function estimation are performed on the SAR image to be detected, and the strong scattering points in the ship target area in the SAR image to be detected are extracted;

[0161] Based on the strong scattering points and the initial feature map, the strong scattering points are embedded to obtain the scattering point embedding feature map;

[0162] Use the cascaded cross attention mechanism to establish the spatial position relationship of feature maps;

[0163] The final feature map, i.e., the global feature map, is obtained, and the anchor-free target detection model is used to perform anchor-free regression prediction for the detection head in any direction to obtain and output the position information of the target detection frame of the ship target in the SAR image to be detected.

[0164] like Figure 3 As shown, based on the above embodiment, an embodiment of the present invention provides a SAR image ship target detection device, including:

[0165] An image acquisition module 31 is used to acquire a SAR image to be detected;

[0166] A feature extraction module 32 is used to extract features from the SAR image to be detected, obtain an initial feature map of the SAR image to be detected, and determine strong scattering points in the ship target area in the SAR image to be detected;

[0167] A scattering point embedding module 33 is used to input the initial feature map and the strong scattering points of the ship target area into a deformable convolutional network, wherein the deformable convolutional network is used to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, apply the offset to update the sampling position to obtain an updated position, and obtain and output a scattering point embedding feature map corresponding to the initial feature map based on the updated position;

[0168] The target detection module 34 is used to extract features from the scattering point embedded feature map based on a cascaded cross attention mechanism to obtain a global feature map, and detect the ship target in the SAR image to be detected based on the global feature map.

[0169] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the deformable convolutional network is optimized based on the offset loss;

[0170] The offset loss is calculated based on the following steps:

[0171] Inputting the initial feature map samples of the SAR image samples and the strong scattering points of the ship target sample area in the SAR image samples into the initial convolution network, wherein the initial convolution network is used to predict the offset samples of each sampling position of the convolution kernel based on the strong scattering points of the ship target sample area;

[0172] Based on the actual offset of each sampling position of the convolution kernel in the initial feature map sample and the offset sample, a smooth L1 loss function is applied to calculate the offset loss.

[0173] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the target detection module is specifically used for:

[0174] The global feature map is input into an anchor-free target detection model; the anchor-free target detection model is used to calculate a regression prediction vector at each feature point of the global feature map, and based on the target mapping points of each feature point in the global feature map in the SAR image to be detected, and the distance information corresponding to the target mapping points in the regression prediction vector, calculate the position information of the target detection frame of the ship target.

[0175] On the basis of the above-mentioned embodiment, the SAR image ship target detection device provided in the embodiment of the present invention further includes a model training module for:

[0176] Inputting a global feature map sample of the SAR image sample into an initial target detection model, and calculating a regression prediction vector sample at each feature point of the global feature map sample by the initial target detection model;

[0177] For any feature point in the global feature map sample, determine a mapping point sample of the any feature point in the SAR image sample, and if the mapping point sample is located in a marked box of a ship target sample in the SAR image sample, determine the mapping point sample as an initial positive sample point;

[0178] Based on the initial positive sample points and the regression prediction vector samples, the initial object detection model is trained to obtain the anchor-free object detection model.

[0179] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the annotation box includes a horizontal annotation box and a rotation annotation box; accordingly, the model training module is specifically used for:

[0180] Calculate first position information and first area information of the horizontal detection frame based on the initial positive sample point and first distance information from the initial positive sample point to the horizontal detection frame in the regression prediction vector sample;

[0181] Based on the first position information, calculating second position information and second area information of the rotation detection frame where the initial positive sample point is located;

[0182] Determine a detection frame rotation factor of the initial positive sample point based on the first area information and the second area information, and determine a regression target of the initial positive sample point based on the detection frame rotation factor or based on a size relationship between the first area information and the second area information;

[0183] Based on the initial positive sample points and their regression targets and the regression prediction vector samples, the rotation factor loss is applied to train the initial target detection model to obtain the anchor-free target detection model;

[0184] The rotation factor loss is determined based on the detection frame rotation factor and the annotation frame rotation factor, and the annotation frame rotation factor is determined based on the horizontal annotation frame and the rotation annotation frame.

[0185] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the feature extraction module is specifically used for:

[0186] Based on the principal component analysis method, determining the principal axis of the ship target in the ship target area, and calculating the normalized distance from each pixel point in the ship target area to the principal axis;

[0187] Based on the kernel density estimation method, the kernel density value of each pixel point in the ship target area is calculated, and based on the normalized distance corresponding to each pixel point in the ship target area and the kernel density value, the confidence of each pixel point in the ship target area as a strong scattering point is calculated;

[0188] Based on the confidence level corresponding to each pixel point in the ship target area, a strong scattering point in the ship target area is determined.

[0189] On the basis of the above embodiments, in the SAR image ship target detection device provided in the embodiments of the present invention, the deformable convolutional network is specifically used for:

[0190] Based on a bilinear interpolation method, the feature values ​​of feature points around the update position in the initial feature map are applied to calculate the feature value at the update position in the initial feature map.

[0191] Specifically, the functions of each module in the SAR image ship target detection device provided in the embodiment of the present invention correspond one-to-one to the operating procedures of each step in the above method embodiment, and the effects achieved are also consistent. Please refer to the above embodiment for details, which will not be repeated in the embodiment of the present invention.

[0192] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the SAR image ship target detection method provided in the above embodiments.

[0193] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0194] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the SAR image ship target detection method provided in the above embodiments.

[0195] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the SAR image ship target detection method provided in the above embodiments.

[0196] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0197] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting ship targets in SAR images. It is characterized in that include: Acquire the SAR image to be detected; Performing feature extraction on the SAR image to be detected to obtain an initial feature map of the SAR image to be detected, and determining strong scattering points in the ship target area in the SAR image to be detected; The initial feature map and the strong scattering points of the ship target area are input into a deformable convolutional network, wherein the deformable convolutional network is used to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, apply the offset to update the sampling position to obtain an updated position, and obtain and output a scattering point embedding feature map corresponding to the initial feature map based on the updated position; Based on a cascaded cross attention mechanism, feature extraction is performed on the scattering point embedding feature map to obtain a global feature map, and based on the global feature map, the ship target in the to-be-detected SAR image is detected; The step of determining strong scattering points in the ship target area in the to-be-detected SAR image comprises: Based on the principal component analysis method, determining the principal axis of the ship target in the ship target area, and calculating the normalized distance from each pixel point in the ship target area to the principal axis; Based on the kernel density estimation method, the kernel density value of each pixel point in the ship target area is calculated, and based on the normalized distance corresponding to each pixel point in the ship target area and the kernel density value, the confidence of each pixel point in the ship target area as a strong scattering point is calculated; Determining a strong scattering point in the ship target area based on the confidence corresponding to each pixel point in the ship target area; The cascaded cross attention mechanism is implemented through two consecutive cross attention structures. One cross attention structure starts from the first feature point of the scattering point embedding feature map, extracts features in the horizontal direction and the vertical direction respectively, and establishes an association relationship between the first feature point and the adjacent feature points in the horizontal direction and the vertical direction. The other cross attention structure starts from the adjacent feature points in the horizontal direction and the vertical direction respectively, extracts features in the vertical direction and the horizontal direction respectively, establishes an association relationship between the two adjacent feature points and the second feature point, associates the first feature point with the second feature point, and obtains the global feature map.

2. The SAR image ship target detection method according to claim 1, It is characterized in that The deformable convolutional network is optimized based on the offset loss; The offset loss is calculated based on the following steps: Inputting the initial feature map samples of the SAR image samples and the strong scattering points of the ship target sample area in the SAR image samples into the initial convolution network, wherein the initial convolution network is used to predict the offset samples of each sampling position of the convolution kernel based on the strong scattering points of the ship target sample area; Based on the actual offset of each sampling position of the convolution kernel in the initial feature map sample and the offset sample, a smooth L1 loss function is applied to calculate the offset loss.

3. The SAR image ship target detection method according to claim 1, It is characterized in that The detecting of the ship target in the to-be-detected SAR image based on the global feature map includes: The global feature map is input into an anchor-free target detection model; the anchor-free target detection model is used to calculate a regression prediction vector at each feature point of the global feature map, and based on the target mapping points of each feature point in the global feature map in the SAR image to be detected, and the distance information corresponding to the target mapping points in the regression prediction vector, calculate the position information of the target detection frame of the ship target.

4. The SAR image ship target detection method according to claim 3, It is characterized in that The anchor-free object detection model is trained based on the following steps: Inputting a global feature map sample of the SAR image sample into an initial target detection model, and calculating a regression prediction vector sample at each feature point of the global feature map sample by the initial target detection model; For any feature point in the global feature map sample, determine a mapping point sample of the any feature point in the SAR image sample, and if the mapping point sample is located in a marked box of a ship target sample in the SAR image sample, determine the mapping point sample as an initial positive sample point; Based on the initial positive sample points and the regression prediction vector samples, the initial object detection model is trained to obtain the anchor-free object detection model.

5. The SAR image ship target detection method according to claim 4, It is characterized in that The annotation box includes a horizontal annotation box and a rotation annotation box; accordingly, the initial target detection model is trained based on the initial positive sample points and the regression prediction vector samples to obtain the anchor-free target detection model, including: Calculate first position information and first area information of the horizontal detection frame based on the initial positive sample point and first distance information from the initial positive sample point to the horizontal detection frame in the regression prediction vector sample; Based on the first position information, calculating second position information and second area information of the rotation detection frame where the initial positive sample point is located; Determine a detection frame rotation factor of the initial positive sample point based on the first area information and the second area information, and determine a regression target of the initial positive sample point based on the detection frame rotation factor or based on a size relationship between the first area information and the second area information; Based on the initial positive sample points and their regression targets and the regression prediction vector samples, the rotation factor loss is applied to train the initial target detection model to obtain the anchor-free target detection model; The rotation factor loss is determined based on the detection frame rotation factor and the annotation frame rotation factor, and the annotation frame rotation factor is determined based on the horizontal annotation frame and the rotation annotation frame.

6. The method for detecting ship targets in SAR images according to any one of claims 1 to 5, It is characterized in that The deformable convolutional network is specifically used for: Based on a bilinear interpolation method, the feature values ​​of feature points around the updated position in the initial feature map are applied to calculate the feature value at the updated position in the initial feature map.

7. A SAR image ship target detection device, It is characterized in that include: An image acquisition module is used to acquire the SAR image to be detected; A feature extraction module is used to extract features from the SAR image to be detected, obtain an initial feature map of the SAR image to be detected, and determine strong scattering points in the ship target area in the SAR image to be detected; a scattering point embedding module, configured to input the initial feature map and the strong scattering points of the ship target area into a deformable convolutional network, wherein the deformable convolutional network is configured to predict the offset of each sampling position of the convolution kernel based on the strong scattering points of the ship target area, apply the offset to update the sampling position to obtain an updated position, and obtain and output a scattering point embedding feature map corresponding to the initial feature map based on the updated position; A target detection module is used to extract features from the scattering point embedding feature map based on a cascaded cross attention mechanism to obtain a global feature map, and detect the ship target in the SAR image to be detected based on the global feature map; The feature extraction module is specifically used for: Based on the principal component analysis method, determining the principal axis of the ship target in the ship target area, and calculating the normalized distance from each pixel point in the ship target area to the principal axis; Based on the kernel density estimation method, the kernel density value of each pixel point in the ship target area is calculated, and based on the normalized distance corresponding to each pixel point in the ship target area and the kernel density value, the confidence of each pixel point in the ship target area as a strong scattering point is calculated; Determining a strong scattering point in the ship target area based on the confidence corresponding to each pixel point in the ship target area; The cascaded cross attention mechanism is implemented through two consecutive cross attention structures. One cross attention structure starts from the first feature point of the scattering point embedding feature map, extracts features in the horizontal direction and the vertical direction respectively, and establishes an association relationship between the first feature point and the adjacent feature points in the horizontal direction and the vertical direction. The other cross attention structure starts from the adjacent feature points in the horizontal direction and the vertical direction respectively, extracts features in the vertical direction and the horizontal direction respectively, establishes an association relationship between the two adjacent feature points and the second feature point, associates the first feature point with the second feature point, and obtains the global feature map.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the SAR image ship target detection method as described in any one of claims 1-6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for detecting ship targets in SAR images as described in any one of claims 1 to 6 is implemented.