A SAR ship detection method based on contour enhancement and multi-level information interaction enhancement

By employing contour enhancement and multi-level information interaction enhancement methods, the problems of background interference and ship feature diversity in SAR ship detection are solved, improving detection accuracy and robustness, especially the detection capability for small ships.

CN117475326BActive Publication Date: 2026-11-24SHANGHAI UNIV OF ENG SCI
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing SAR ship detection methods are easily confused by complex coastlines and port background interference. Changes in ship size and angle can lead to false alarms or missed detections. Furthermore, traditional methods do not fully utilize the characteristics of SAR images.

Method used

A method based on contour enhancement and multi-level information interaction enhancement is adopted. Ship contour features are extracted by anisotropic diffusion filtering and Sobel operator, and a multi-level information interaction enhancement network YOLOx model is constructed to enhance ship contour information and integrate shallow and deep features.

Benefits of technology

It improves the accuracy and interpretability of ship inspection, reduces the impact of speckle noise, enhances the inspection capability for small ships, and improves inspection precision and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117475326B_ABST
    Figure CN117475326B_ABST
Patent Text Reader

Abstract

This invention relates to the field of radar ship detection technology, specifically disclosing a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement, comprising the following steps: S110, constructing a SAR ship image preprocessing method for contour enhancement, processing the acquired SSDD dataset using the preprocessing method, and dividing the processed dataset into a training set, a test set, and a validation set according to a certain ratio; S120, constructing a YOLOx network model based on a multi-level information interaction enhancement network for SAR image ship target detection, training the network model using the training set, and obtaining the optimal detection model; S130, using the trained optimal detection model to detect the image data to be detected and obtaining the SAR image ship target detection result; This invention designs a SAR image preprocessing method that effectively reduces the influence of speckle noise, enhances the contour features of ships, solves the problem of inaccurate detection in complex backgrounds, and achieves high accuracy in ship detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of radar ship detection technology, specifically a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement. Background Technology

[0002] Synthetic Aperture Radar (SAR) is a remote sensing technology that uses microwave signals to create high-resolution images of the Earth's surface. Compared to traditional maritime surveillance methods, SAR technology has several advantages, including the ability to achieve continuous, all-weather observation. Therefore, it has been widely used in both civilian and military fields. With the increasing availability of SAR data from satellites and airborne platforms, SAR ship detection is expected to become more widespread and play a crucial role in maritime surveillance and monitoring. Due to the unique characteristics of SAR imaging, the manual interpretation of SAR images is a time-consuming and labor-intensive process, resulting in a significant underutilization of data. Therefore, ship detection in SAR images is an attractive, challenging, and meaningful research direction.

[0003] The development of SAR image target detection technology can be introduced from two aspects: traditional SAR target detection and deep learning-based SAR ship detection. Traditional SAR image detection algorithms mainly consist of three steps: preprocessing, candidate region extraction, and target differentiation. Candidate region extraction uses the constant false alarm rate (CFAR) method, employing statistical modeling and a CFAR threshold to identify pixels exceeding the threshold as ships and those below as background. Target differentiation utilizes manually designed features and classifiers, including simple features such as length, width, and aspect ratio, as well as more robust features introduced using computer vision techniques. Deep learning-based target detection methods are mainly divided into single-stage and two-stage detection algorithms based on the different steps and methods employed. Two-stage detectors divide the target detection task into two stages. First, a region proposal network generates candidate target regions. Then, these regions are classified and bounding box regressed to obtain the final target detection result. Single-stage target detectors do not need to generate candidate regions but directly predict the target's location and category in one step. They use a single neural network to simultaneously output the target's location coordinates and category probability, thus achieving faster detection speeds.

[0004] While the aforementioned methods exhibit excellent performance, several challenges remain when directly applied to SAR ship detection. Most existing target detectors are designed based on visible light images, and many studies directly utilize them for SAR image detection without considering the unique characteristics of SAR images. SAR images contain complex background interference such as coastlines, ports, and buoys, which can easily be confused with target ships, reducing detection accuracy. Furthermore, the size and angle of a ship vary with distance, attitude, and motion, meaning that the SAR reflection characteristics of a ship exhibit diversity under different conditions, leading to false alarms or missed detections. Summary of the Invention

[0005] The purpose of this invention is to provide a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement, comprising the following steps:

[0007] S110. Construct a SAR ship image preprocessing method for contour enhancement, process the acquired SSDD dataset using the preprocessing method, and divide the processed dataset into training set, test set and validation set according to a certain ratio.

[0008] S120. Construct a YOLOx network model based on a multi-level information interaction enhancement network for ship target detection in SAR images, train the network model using the training set, and obtain the optimal detection model.

[0009] S130. Use the optimal detection model obtained from training to detect the image data to be detected and obtain the SAR image ship target detection results.

[0010] Preferably, the SAR ship image preprocessing method in step S110 includes the following steps:

[0011] S111. Perform anisotropic diffusion filtering on SAR ship images to smooth speckle noise while preserving and enhancing ship edge information to the maximum extent.

[0012] S112. Use the Sobel operator to extract contour features from the anisotropically diffused filtered image to obtain the high-frequency contour information of the ship.

[0013] S113. The original image is used as the first channel, the image after anisotropic diffusion filtering and edge preservation and denoising is used as the second channel, and the high-frequency contour information image after extraction by the Sobel operator is used as the third channel to form a three-channel SAR image with rich contour information.

[0014] The preferred method for performing anisotropic diffusion filtering on SAR ship images is as follows:

[0015] Iterate through the input SAR ship images. For the current pixel (x, y), first calculate its grayscale gradient in the eight adjacent directions, denoted as: Where (k = 1, 2, 3, ..., 8); then, the gray values ​​I0(x, y) in the original image are regarded as the input of the anisotropic diffusion filter at zero, and a new image is obtained after filtering:

[0016]

[0017] Where I(x,y;t) represents the output of the anisotropic diffusion filter at time t. Let c represent the gradient operator. k (x, y; t) represents the diffusion coefficient of the current pixel in the k-th neighborhood direction at time t, used to control the diffusion rate. Its construction method is as follows:

[0018]

[0019] Where K is the thermal conductivity coefficient, used to control the sensitivity of the edge.

[0020] Preferably, in step S110, the preprocessed dataset is divided into a training set and a test set in a ratio of 8:2.

[0021] Preferably, the multi-level information interaction enhancement network includes a 1×1 convolutional layer, a first upsampling module, a first stitching module, a first deformable space attention module, a second upsampling module, a second stitching module, a second deformable space attention module, a first downsampling module, a third stitching module, a first deformable channel attention module, a second downsampling module, a third stitching module, and a second deformable channel attention module; wherein,

[0022] The 1×1 convolutional layer is used to input a feature map at a first scale. The first upsampling module, the first stitching module, the first deformable spatial attention module, the second upsampling module, the second stitching module, and the second deformable spatial attention module are sequentially connected to the output of the 1×1 convolutional layer. The output of the first upsampling module and the feature map at the second scale are stitched together in the first stitching module. The output of the second upsampling module and the feature map at the third scale are stitched together in the second stitching module. The second deformable spatial attention module is used to output a predicted feature map at the third scale.

[0023] The first downsampling module, the third stitching module, and the first deformable channel attention module are sequentially connected to the output of the second deformable space attention module; the output of the first downsampling module and the output of the first deformable space attention module are feature-stitched in the third stitching module; the first deformable channel attention module is used to output a predicted feature map at the second scale;

[0024] The second downsampling module, the fourth stitching module, and the second deformable channel attention module are sequentially connected to the output of the first deformable channel attention module; the output of the second downsampling module and the output of the 1x1 convolutional layer are stitched together in the fourth stitching module; the second deformable channel attention module is used to output the predicted feature map at the first scale.

[0025] Preferably, the first deformable spatial attention module and the second deformable spatial attention module have the same structure, each including three parts. The first part uses deformable convolution to extract deformable features and uses two 1x1 convolutions to adjust the number of channels of the input feature map. The second part uses a spatial attention mechanism. The third part uses 3x3 convolutions to integrate information and further extract features.

[0026] Preferably, the spatial attention mechanism includes horizontal pooling, vertical pooling, a concatenation unit, a 1x1 convolutional layer, a batch normalization layer, a linear activation layer, and a sigmoid function layer, wherein the output expression of the spatial attention unit is:

[0027]

[0028] Where, x c (i,j) is the c-th channel input of the spatial attention mechanism. and These are the attention weights for the horizontal and vertical directions, respectively.

[0029] Preferably, the first deformable channel attention module and the second deformable channel attention module have the same structure, each including three parts: the first part uses deformable convolution to extract deformable features and uses two 1x1 convolutions to adjust the number of channels in the input feature map; the second part uses a channel attention mechanism; and the third part uses 3x3 convolutions to integrate information and further extract features.

[0030] Preferably, the channel attention mechanism includes global average pooling, a 1x1 convolutional layer, a ReLU function layer, and a sigmoid function layer, wherein the output expression of the channel attention unit is:

[0031] Y=σ(Conv(δ(Conv(AvgPool(X)))))·X;

[0032] Where X is the input feature map, Y is the output of channel attention, AvgPool is global average pooling, Conv represents 1x1 convolution, δ represents the ReLU function layer, σ represents the sigmoid function layer, and · represents element-wise multiplication, applying the weights to the original feature map.

[0033] Compared with the prior art, the beneficial effects of the present invention are:

[0034] 1. This invention proposes a SAR ship image preprocessing method based on anisotropic diffusion. This method expands the original single-channel SAR image sent to the network for learning into three channels, reducing the impact of speckle noise and enhancing the ship's contour features. It fully utilizes the network's extraction capabilities and image information, improving the network's interpretability and ability to extract key features;

[0035] 2. This invention proposes a multi-layered information interaction enhancement network, designing a deformable spatial attention module and a deformable channel attention module, and embedding them into the shallow and deep layers of the multi-layered information interaction enhancement network. This effectively integrates shallow features that retain more spatial details and deep features with rich semantic information. It solves the inconsistency of multi-scale features of ships in SAR images, retains more discrete information about small ships, and improves the detectability of small ships. Attached Figure Description

[0036] Figure 1 This is a flowchart of a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement provided by the present invention;

[0037] Figure 2 This is a flowchart of a SAR ship image preprocessing method for contour enhancement provided by the present invention;

[0038] Figure 3 This is a schematic diagram of the structure of a multi-level information interaction enhancement network provided by the present invention;

[0039] Figure 4 This is a structural schematic diagram of a deformable space attention module provided by the present invention;

[0040] Figure 5 This is a structural schematic diagram of a deformable channel attention module provided by the present invention;

[0041] Figure 6 This is a SAR image a containing a ship target provided in an embodiment of the present invention;

[0042] Figure 7 This is a SAR image b containing a ship target provided in an embodiment of the present invention;

[0043] Figure 8 yes Figure 6 The image shown is a SAR ship image after being processed by the contour enhancement SAR image preprocessing method.

[0044] Figure 9 yes Figure 7 The image shown is a SAR ship image after being processed by the contour enhancement SAR image preprocessing method.

[0045] Figure 10 yes Figure 6 The SAR image shown is a ship detection result obtained using the method of this invention;

[0046] Figure 11 yes Figure 7 The SAR image shown is a ship detection result obtained using the method of this invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] The following combination Figures 1-11 The following describes any embodiment of the present invention for further explanation:

[0049] Please see Figure 1 , Figure 1 This is a flowchart illustrating a SAR ship detection method based on contour enhancement and multi-level information interaction enhancement, provided by an embodiment of the present invention. The target detection method includes:

[0050] S110: Construct a data preprocessing method for SAR ship images. The acquired SSDD dataset is processed using the preprocessing method, and the processed dataset is divided into training and test sets according to a certain ratio.

[0051] Please see Figure 2 , Figure 2 This is a schematic diagram of a data preprocessing method for SAR ship images provided in an embodiment of the present invention. The method first utilizes anisotropic diffusion filtering to smooth speckle noise while preserving contour information to the maximum extent possible. The specific method is as follows:

[0052] Iterate through the input SAR ship images. For the current pixel (x, y), first calculate its grayscale gradient in the eight adjacent directions, denoted as: Where (k = 1, 2, 3, ..., 8); then, the gray values ​​I0(x, y) in the original image are considered as the input of the anisotropic diffusion filter at zero, following the following partial differential equation:

[0053]

[0054] Where I(x,y;t) represents the output of the anisotropic diffusion filter at time t. This represents the adjustment amount made by the anisotropic filter to the current pixel of the noisy image at time t. Let c represent the gradient operator. k (x, y; t) represents the diffusion coefficient of the current pixel in the k-th neighborhood direction at time t, used to control the diffusion rate. Its construction method is as follows:

[0055]

[0056] Where K is the thermal conductivity coefficient, used to control the sensitivity of the edge.

[0057] For a fixed value of K, within a homogeneous region, if the gradient in the neighborhood is small, the diffusion coefficient will be relatively large, which helps to effectively smooth noise within the homogeneous region. Conversely, at the edges of the image, the gradient in the neighborhood is large, and the diffusion coefficient is small, thus helping to preserve the edge information of the image. Finally, the filtered image is obtained through this process:

[0058]

[0059] The anisotropic diffusion filtering results for SAR ship images are attached. Figure 2 As shown in the figure, the thermal conductivity coefficient K and the number of iterations are 30 and 12, respectively. As can be seen from the figure, compared with the original image, the image after anisotropic diffusion filtering not only reduces speckle noise but also highlights the contour information of the ship.

[0060] Then, contour feature extraction is performed using the Sobel operator to obtain the ship's high-frequency contour information. The original image is used as the first channel, the image after anisotropic filtering and edge-preserving denoising is used as the second channel, and the high-frequency contour information image extracted by the four-directional Sobel operator is used as the third channel, combining them to form a contour-rich three-channel SAR image. This method preserves all information in the original image and adds important contour information. The results of preprocessing the SAR ship image are shown in the attached figure. Figure 2 As shown, compared with the original image, the preprocessed image makes full use of the effective information in the image, reduces the influence of scattering noise, and greatly enriches the information contained in the training data. This improves the model's accuracy in detecting ships against complex backgrounds.

[0061] Furthermore, in step S110, the preprocessed SSDD dataset is divided into a training set and a test set in an 8:2 ratio.

[0062] S120: Construct a YOLOx network model based on a multi-level information interaction enhancement network for ship target detection in SAR images. Train the network model using the training set to obtain the optimal detection model.

[0063] Please see Figure 3 , Figure 3 This is a schematic diagram of an improved feature fusion network provided in an embodiment of the present invention. The multi-level feature fusion network includes a 1×1 convolutional layer, a first upsampling module, a first stitching module, a first deformable spatial attention module, a second upsampling module, a second stitching module, a second deformable spatial attention module, a first downsampling module, a third stitching module, a first deformable channel attention module, a second downsampling module, a third stitching module, and a second deformable channel attention module. The 1×1 convolutional layer is used to input a feature map at a first scale. The first upsampling module, the first stitching module, the first deformable spatial attention module, the second upsampling module, the second stitching module, and the second deformable spatial attention module are sequentially connected to the output of the 1×1 convolutional layer. The output of the first upsampling module and the feature map at a second scale are stitched together in the first stitching module. The second upsampling module... The block output and the feature map at the third scale are concatenated in the second concatenation module; the second deformable spatial attention module is used to output the predicted feature map at the third scale; the first downsampling module, the third concatenation module, and the first deformable channel attention module are sequentially connected to the output of the second deformable spatial attention module; the output of the first downsampling module and the output of the first deformable spatial attention module are concatenated in the third concatenation module; the first deformable channel attention module is used to output the predicted feature map at the second scale; the second downsampling module, the fourth concatenation module, and the second deformable channel attention module are sequentially connected to the output of the first deformable channel attention module; the output of the second downsampling module and the output of the 1x1 convolutional layer are concatenated in the fourth concatenation module; the second deformable channel attention module is used to output the predicted feature map at the first scale.

[0064] Further, please see Figure 4 , Figure 4 This is a schematic diagram of the deformable spatial attention module structure provided in an embodiment of the present invention. The specific structure of the module is as follows: a 1x1 convolution module, a deformable convolution module, a 1x1 convolution module and a spatial attention module are connected in series, and after being connected in parallel with the residual structure, they are connected in series with the 3x3 convolution module.

[0065] The spatial attention module is used to enhance the SAR ship detection model's ability to perceive and understand targets, improve detection accuracy and robustness, and reduce false alarm rate. Its specific structure is as follows: For the input feature layer, each channel is first encoded along the horizontal and vertical coordinates using two spatial ranges of pooling kernels (H,1) or (1,W). Therefore, the output of the c-th channel at height h can be formulated as:

[0066]

[0067] Similarly, the output of the c-th channel at width w can be written as:

[0068]

[0069] The two transformations described above aggregate features along two spatial directions, generating a pair of orientation-aware feature maps. These two transformations also allow our attention blocks to capture long-range dependencies along one spatial direction while preserving precise location information along the other, which helps the network more accurately locate objects of interest.

[0070] Then, the two transformations mentioned above are concatenated in the spatial dimension, and 1x1 convolution is used to compress the channels. BatchNorm and a non-linear activation function are then used to encode the spatial information in the vertical and horizontal directions. Specifically, the equations are first concatenated... and equations Then they are sent to the shared 1×1 convolution transform function F1 to obtain...

[0071] f=δ(F1([z h ,z w ]));

[0072] Where [·,·] represents the splicing operation along the spatial dimension, and δ represents the nonlinear activation function. This represents an intermediate feature map encoding spatial information in the horizontal and vertical directions. Here, r is a scaling factor used to control the number of channels. Then, we split f into two independent tensors along the spatial dimensions. and The other two 1×1 convolution transformations F h and F w Used to f h and f w Each input X is transformed into a tensor with the same number of channels as the input X, and then normalized and weighted using the sigmoid function. This yields:

[0073] g h =σ(F h (f h )),

[0074] g w =σ(F w (f w ))

[0075] Where σ represents the sigmoid function, and finally, the output of the spatial attention module can be written as:

[0076]

[0077] Further, please see Figure 5 , Figure 5 This is a schematic diagram of the deformable channel attention module structure provided in an embodiment of the present invention. The specific structure of the module is as follows: a 1x1 convolution module, a deformable convolution module, a 1x1 convolution module and a channel attention module are connected in series, and then connected in parallel with the residual structure and connected in series with the 3x3 convolution module.

[0078] The channel attention module is used to optimize feature representation, noise suppression, and target separation, thereby improving the accuracy and reliability of detection. This helps to more reliably detect ship targets in complex SAR images. Its specific structure is as follows: First, a globally averaged feature vector is obtained through global average pooling:

[0079]

[0080] Then, we process the vector z obtained in the previous step through two 1x1 convolution operations to obtain the channel weight values ​​s we want.

[0081] s=σ(Conv(δ(Conv(z))));

[0082] Here, Conv represents a 1x1 convolution operation, δ represents the ReLU activation function, and σ represents the sigmoid activation function. After two 1x1 convolutions, different values ​​in s represent the weight information of different channels, assigning different weights to the channels.

[0083] Finally, the calculated channel weights are used to weight the feature maps of each channel. Typically, the feature map of each channel is multiplied by the corresponding channel weight to either amplify or suppress channel information. The output of the channel attention module can then be written as:

[0084] Y = s·X;

[0085] Where X is the input feature map and Y is the output of the channel attention.

[0086] S130: Use the optimal detection model obtained from training to detect the image data to be detected and obtain the SAR image ship target detection results.

[0087] Specifically, during the prediction process, classification and regression operations are performed on the feature layers at three scales to output the center point position of the ship target, the width and height of the detection box, the category of the detected target, and the confidence level.

[0088] The following simulation experiments further illustrate the effectiveness of the SAR image ship target detection method of this invention.

[0089] (1) Simulation conditions: The graphics card used in the simulation experiment is NVIDIA GeForce RTX 2060 6GB, the CPU is AMD Ryzen 7 4800HS, the memory is 16G, the operating system is Windows 10, the Python version is 3.8, and the PyTorch version is 1.9.0.

[0090] The dataset used in the simulation experiment was the publicly available SSDD dataset, which includes 1160 images collected from three different satellites, totaling 2456 ship targets. Of these, 928 images were used for training, while the remaining 232 were used for testing.

[0091] In the simulation experiment, a learning rate of lr × batchsize / 64 was used, employing a cosine learning rate timer and an initial learning rate of 0.01. Weights decayed to 0.0005, and the SGD momentum was 0.9. A total of 500 epochs were trained over 500 retries, with a batch size of 16 and an IOU threshold of 0.5. During training, the optimal model was saved until training was complete, and the last trained model was also saved for subsequent training.

[0092] The relevant evaluation indicators and their definitions used in the simulation experiment are as follows:

[0093] Accuracy represents the ratio between the number of correctly detected positive targets and the total number of positive targets detected. It measures the model's accuracy in predicting positive targets and can be expressed as:

[0094] Precision = TP / (TP+FP);

[0095] Recall: Represents the ratio between the number of correctly detected positive targets and the total number of positive targets. It measures the proportion of positive targets detected by the model and can be expressed as:

[0096] Recall = TP / (TP+FN);

[0097] Average precision (AP) is a metric used to measure the performance of a model across different classes. It calculates the area under the precision-recall curve for each class and is an important comprehensive indicator of object detection performance, which can be expressed as:

[0098]

[0099] Where TP represents the number of positive class samples correctly predicted as positive class, i.e., the number of correctly detected targets; FP represents the number of negative class samples incorrectly predicted as positive class, i.e., the number of incorrectly detected targets; and FN represents the number of positive class samples incorrectly predicted as negative class, i.e., the number of targets not correctly detected. P represents precision, and R represents recall.

[0100] (2) Simulation Experiment Content: Ship target detection will be performed on the SSDD public dataset using both the present invention and the existing deep learning ship detection algorithm (YOLOx), and relevant evaluation metrics will be calculated. Among these, Figure 6 , Figure 7 It displays SAR images containing ship targets. Figure 8 , Figure 9 This displays SAR images of ships after image preprocessing. Figure 10 , Figure 11 The results of the ship detection using SAR images presented in this invention are shown.

[0101] Furthermore, by comparing the detection results of detection network models based on the original YOLOx and the improved YOLOx, this invention can improve the accuracy of target detection.

[0102] The experimental results are shown in the table below.

[0103] Comparison Table of Simulation Results for Ship Target Detection in SAR Images

[0104]

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it; although referring to

[0106] The foregoing embodiments have provided a detailed description of the present invention. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A SAR ship detection method based on contour enhancement and multi-level information interaction enhancement, characterized in that: Includes the following steps: S110. Construct a SAR ship image preprocessing method for contour enhancement, process the acquired SSDD dataset using the preprocessing method, and divide the processed dataset into training set, test set and validation set according to a certain ratio. The SAR ship image preprocessing method in step S110 includes the following steps: S111. Perform anisotropic diffusion filtering on SAR ship images to smooth speckle noise while preserving and enhancing ship edge information to the maximum extent. S112. Use the Sobel operator to extract contour features from the anisotropically diffused filtered image to obtain the high-frequency contour information of the ship. S113. The original image is used as the first channel, the image after edge preservation and noise reduction by anisotropic diffusion filtering is used as the second channel, and the high-frequency contour information image after extraction by the Sobel operator is used as the third channel to form a three-channel SAR image with rich contour information. The specific method for performing anisotropic diffusion filtering on SAR ship images is as follows: Iterate through the input SAR ship images, targeting the current pixel. First, calculate its gray-level gradient in eight adjacent directions, expressed as: ,in Next, the grayscale values ​​in the original image are... Considered as the input to the anisotropic diffusion filter at time zero, a new image is obtained after filtering: ; in This indicates that in The output of the anisotropic diffusion filter at any given time. Represents the gradient operator, Indicates the current pixel is in Time of the first The diffusion coefficients in each neighborhood direction are used to control the diffusion rate, and their construction method is as follows: ; in It is the thermal conductivity coefficient, used to control the sensitivity of the edges; S120. Construct a YOLOx network model based on a multi-level information interaction enhancement network for ship target detection in SAR images, train the network model using the training set, and obtain the optimal detection model. The multi-level information interaction enhancement network includes a 1×1 convolutional layer, a first upsampling module, a first stitching module, a first deformable space attention module, a second upsampling module, a second stitching module, a second deformable space attention module, a first downsampling module, a third stitching module, a first deformable channel attention module, a second downsampling module, a fourth stitching module, and a second deformable channel attention module. The first deformable spatial attention module and the second deformable spatial attention module have the same structure, both consisting of three parts. The first part uses deformable convolution to extract deformable features and uses two 1×1 convolutional layers to adjust the number of channels in the input feature map. The second part uses a spatial attention mechanism. The third part uses 3x3 convolutional layers to integrate information and extract further features. The first deformable channel attention module and the second deformable channel attention module have the same structure, both consisting of three parts. The first part uses deformable convolution to extract deformable features and uses two 1x1 convolutional layers to adjust the number of channels in the input feature map. The second part uses a channel attention mechanism. The third part uses a 3x3 convolutional layer to integrate information and further extract features. S130. Use the optimal detection model obtained from training to detect the image data to be detected and obtain the SAR image ship target detection results.

2. The SAR ship detection method based on contour enhancement and multi-level information interaction enhancement according to claim 1, characterized in that: The 1×1 convolutional layer is used to input a feature map of the first scale. The first upsampling module, the first stitching module, the first deformation space attention module, the second upsampling module, the second stitching module, and the second deformation space attention module are sequentially connected to the output of the 1×1 convolutional layer. The output of the first upsampling module and the feature map of the second scale are stitched together in the first stitching module. The output of the second upsampling module and the feature map at the third scale are concatenated in the second concatenation module; the second deformation space attention module is used to output the predicted feature map at the third scale. The first downsampling module, the third stitching module, and the first deformation channel attention module are sequentially connected to the output end of the second deformation space attention module; the output of the first downsampling module and the output of the first deformation space attention module are feature-stitched in the third stitching module; The first deformation channel attention module is used to output a predicted feature map at the second scale; The second downsampling module, the fourth stitching module, and the second deformable channel attention module are sequentially connected to the output of the first deformable channel attention module; the output of the second downsampling module and the output of the 1x1 convolutional layer are stitched together in the fourth stitching module. The second deformation channel attention module is used to output the predicted feature map at the first scale.

3. The SAR ship detection method based on contour enhancement and multi-level information interaction enhancement according to claim 2, characterized in that: The spatial attention mechanism includes horizontal pooling, vertical pooling, splicing units, 1x1 convolutional layers, batch normalization layers, linear activation layers, and sigmoid function layers. The output expression of the spatial attention mechanism is: ; in, It is the first spatial attention mechanism One input channel, and These are the attention weights for the horizontal and vertical directions, respectively.

4. The SAR ship detection method based on contour enhancement and multi-level information interaction enhancement according to claim 3, characterized in that: The channel attention mechanism includes global average pooling, a 1x1 convolutional layer, a ReLU function layer, and a sigmoid function layer. The output expression of the channel attention mechanism is: ; in, It is the input feature map. It is the output of channel attention. For global average pooling, This represents a 1x1 convolution. Represents the ReLU function layer. Represents the sigmoid function layer. This indicates element-wise multiplication, applying the weights to the original feature map.