Multi-scale SAR image ship detection method and system based on edge enhancement and diffusion denoising

By employing an edge enhancement-dynamic fusion-diffusion denoising detection framework, the problems of weakened edge information and loss of small target features under the influence of noise in SAR images are solved, achieving high-precision and robust ship target detection.

CN121545004APending Publication Date: 2026-02-17XIDIAN UNIV

Patent Information

Application Number
CN202511715770.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing SAR image ship detection methods have shortcomings in handling edge information weakening under noise, loss of small target features during fusion, and iterative refinement of detection boxes, resulting in low detection accuracy and poor robustness.

Method used

A three-level collaborative detection framework of edge enhancement, dynamic fusion, and diffusion denoising is adopted. Through local contrast adaptive differential enhancement operation, dynamic channel fusion enhancement strategy and diffusion model detection head, feature quality is improved and accurate detection is achieved.

Benefits of technology

It significantly improves the detection accuracy and robustness of multi-scale ship targets in SAR images, better suppresses noise, preserves small target features, and optimizes the bounding box position through iterative denoising, thereby improving detection performance under complex sea conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121545004A_ABST
    Figure CN121545004A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-scale SAR (Synthetic Aperture Radar) image ship detection method and system based on edge enhancement and diffusion denoising, and mainly solves the problems that the existing SAR ship detection method is sensitive to noise and poor in small target feature extraction capability. According to the implementation scheme, the method comprises the following steps: obtaining an SAR image, carrying out standardized preprocessing, inputting the SAR image into a deep convolutional neural network, extracting a multi-scale feature map, and carrying out dynamic channel fusion enhancement on a low-layer feature map in the multi-scale feature map to obtain a fused high-quality feature map; performing differential edge enhancement on middle and high-level feature maps in the multi-scale feature map, and inputting the enhanced feature map and the fused feature map into a diffusion model detection head for training; and inputting a to-be-detected SAR image into the trained diffusion model detection head, outputting a preliminary target bounding box and a category confidence coefficient, performing score screening and non-maximum suppression operation on the preliminary target bounding box and the category confidence coefficient, and generating a final ship target detection result. According to the method, the precision and robustness of SAR image ship detection are remarkably improved, and the method can be used for ocean monitoring and military reconnaissance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and radar image processing technology, specifically relating to a ship target detection method for synthetic aperture radar images, which can be used for automatic detection and identification of ship targets in SAR images in scenarios such as marine monitoring, military reconnaissance, and maritime traffic management. Background Technology

[0002] Synthetic Aperture Radar (SAR) possesses all-weather, all-day imaging capabilities, playing an irreplaceable role in fields such as maritime surveillance and military reconnaissance. Ship target detection is one of the core tasks of SAR image interpretation, but it faces challenges such as multiplicative speckle noise, weak features of small targets, and large differences in target scale, ranging from small boats of tens of pixels to aircraft carriers of hundreds of pixels. These challenges lead to poor performance of traditional detection models in SAR images, especially with high rates of missed detections and false alarms for small targets.

[0003] Currently, most mainstream SAR ship detection methods are based on convolutional neural network (CNN) architectures, such as Faster R-CNN and the YOLO series. While these methods have made some progress by pre-training on natural images and then transferring them to the SAR domain, they lack explicit modeling and suppression mechanisms for the multiplicative speckle noise unique to SAR images. This results in the noise being amplified during feature extraction, making false alarms more likely.

[0004] To improve feature representation capabilities, some improvement schemes have emerged in existing technologies.

[0005] Patent document CN117935050A discloses a SAR ship target detection method and system based on effective feature representation. Its core lies in using the CMCVit module, the bidirectional attention mechanism (BAM), and the multi-branch spatial pyramid module (MBSPP) for feature extraction and fusion. While this type of method improves detection performance to some extent by enhancing feature extraction and fusion capabilities and showing some improvement in feature representation, it still fails to fundamentally solve core problems such as the destruction of edge information by multiplicative speckle noise in SAR images, insufficient preservation of small target features, and insufficient spatial adaptability of multi-scale targets in feature fusion. Furthermore, its detection head still relies on a traditional regression mechanism and lacks the ability to progressively optimize noisy bounding boxes, resulting in limited bounding box positioning accuracy under complex sea conditions.

[0006] To address these issues, diffusion models have been introduced into the field of target detection, achieving high-precision detection through progressive denoising. However, directly applying such generative models to low signal-to-noise ratio SAR image features can lead to convergence difficulties and performance degradation due to the mismatch between feature conditions and the denoising process.

[0007] In summary, existing technologies have failed to systematically solve the three core challenges in SAR ship detection: "weakened edge information under noise", "loss of small target features during fusion", and "iterative refinement of detection boxes". As a result, they suffer from low detection accuracy and poor robustness when processing SAR images. Summary of the Invention

[0008] The purpose of this invention is to address the shortcomings of the prior art by proposing a multi-scale SAR image ship detection method and system based on edge enhancement and diffusion denoising, so as to improve the detection accuracy and robustness of multi-scale ship targets in SAR images.

[0009] The technical approach to achieve the above objectives is to improve feature quality through a three-level collaborative detection framework of "edge enhancement - dynamic fusion - diffusion denoising" and combine it with a diffusion model to achieve accurate detection.

[0010] Based on the above ideas, the technical solution of the present invention includes:

[0011] 1. A multi-scale SAR image ship detection method based on edge enhancement and diffusion denoising, characterized in that it includes:

[0012] (1) Input SAR images and perform standardized preprocessing to obtain SAR image data to be detected;

[0013] (2) Input the SAR image to be detected into a deep convolutional neural network to extract multi-scale feature maps;

[0014] (3) Dynamic channel fusion enhancement is performed on the low-level feature maps in the multi-scale feature maps to obtain high-quality fused feature maps;

[0015] (4) Perform differential edge enhancement on the mid-to-high-level feature maps in the multi-scale feature maps to obtain enhanced high-quality feature maps;

[0016] (5) Input the enhanced feature map and the fused feature map into the diffusion model detection head and train it;

[0017] (6) Input the SAR image to be detected into the trained diffusion model detection head, perform iterative denoising inference, and output the preliminary ship target bounding box and category confidence.

[0018] (7) Post-process the preliminary output results, including score filtering and non-maximum suppression operations, to generate the final ship target detection results.

[0019] Furthermore, the dynamic channel fusion enhancement of the low-level feature maps in the multi-scale feature maps in (3) includes:

[0020] 3a) Select the low-level feature map P2 from the multi-scale feature maps extracted from the deep convolutional neural network;

[0021] 3b) Generate a set of spatially adaptive convolution kernels related to spatial location from the low-level feature map P2 through an involution operation;

[0022] 3c) Using the spatial adaptive convolution kernel generated in step 3b), the local neighborhood of P2 is weighted and aggregated to obtain dynamically enhanced features;

[0023] 3d) Concatenate the low-level feature map P2 with the dynamically enhanced features output in step 3c) along the channel dimension to obtain a dual-path feature representation;

[0024] 3e) The concatenated dual-path features are compressed through a 1×1 convolutional layer to reduce the number of channels from 2C to C, and batch normalization and ReLU activation functions are applied sequentially to output the final dynamic channel fusion enhancement features.

[0025] Furthermore, the differential edge enhancement of the mid-to-high-level feature maps in the multi-scale feature maps in step (4) includes:

[0026] 4a) Select mid-to-high-level feature maps P3, P4, and P5 from the multi-scale feature maps extracted from the deep convolutional neural network;

[0027] 4b) For each mid-to-high-level feature map, select a local receptive field region at each spatial location. Constructing a structure from the central pixel With each neighboring pixel The set of pixel pairs ;

[0028] 4c) Based on the set of pixel pairs, calculate the local difference response through pixel difference to obtain a difference-enhanced feature map with the same size as the input feature map. ;

[0029] 4d) Enhance the differential feature map Compared with the original input feature map Weighted fusion is performed using residual connections to obtain the final enhanced output feature map. ;

[0030] 4e) The mid-to-high-level feature maps obtained after the above processing are stitched together with the feature maps obtained after dynamic channel fusion enhancement to form a complete multi-scale enhanced feature pyramid, which is used for subsequent regional feature alignment and iterative denoising detection of the diffusion detection head.

[0031] 2. A multi-scale SAR image ship detection system based on edge enhancement and diffusion denoising, characterized in that it comprises:

[0032] The data preprocessing module is used to standardize the input SAR image;

[0033] The multi-scale feature extraction module is used to extract multi-scale feature maps from SAR images;

[0034] The dynamic channel fusion enhancement module is used to spatially adaptively fuse low-level feature maps;

[0035] The differential edge enhancement module is used to enhance edge features in mid-to-high-level feature maps and suppress noise;

[0036] The diffusion model detection head module is used to receive the multi-scale feature pyramid composed of the feature maps enhanced by the dynamic channel fusion enhancement module and the differential edge enhancement module, and through an iterative denoising process, gradually optimize and predict the ship category confidence and ship bounding box coordinates of the target from the initial noise box distribution.

[0037] The output module is used to perform score filtering and non-maximum suppression (NMS) operations on the bounding box prediction results output by the diffusion model detection head module based on its category probability distribution, and generate detection results containing the final target category and the precise ship target bounding box coordinates.

[0038] Compared with existing technologies, the present invention has the following advantages:

[0039] First, this invention introduces a local contrast adaptive differential enhancement operation in the feature extraction stage. By calculating the absolute difference between the center pixel and all pixels in its neighborhood at each spatial location, and dynamically generating an enhanced response based on the mean and standard deviation of this local difference, it not only explicitly amplifies the anisotropic features of the ship target edge but also effectively suppresses multiplicative speckle noise with local self-similarity. Compared with existing methods that rely on global attention weights or fixed filters, this operation introduces direction-sensitive weights and a nonlinear enhancement function, which can dynamically adjust the enhancement intensity according to the characteristics of the local region, thereby improving the signal-to-noise ratio of the input features from the source.

[0040] Second, this invention employs a dynamic channel fusion enhancement strategy based on involution, which adaptively generates spatially specific convolutional kernels according to the content of low-level feature maps and dynamically weights and fuses multi-scale features along the channel dimension. Compared to feature fusion methods such as FPN that use fixed linear operations, such as addition or concatenation, this invention can more accurately preserve and enhance the weak features of small-scale ship targets, significantly alleviating the information loss problem caused by deep downsampling of the network.

[0041] Third, this invention introduces a diffusion model into the detection head, constructing a bounding box optimization mechanism based on iterative denoising. This mechanism starts from random noise boxes and gradually refines the position and size of the bounding boxes through multiple iterations, rather than relying on a single regression. Compared with traditional single-regression detection heads, this progressive optimization method is more robust to blurred, incomplete, or low-contrast targets commonly found in SAR images, enabling higher-precision localization.

[0042] Fourth, this invention organically integrates the aforementioned feature enhancement steps with the diffusion denoising detection steps to form an end-to-end detection process. The front-end differential edge enhancement and dynamic channel fusion provide high-quality, robust multi-scale feature conditions for the diffusion detection head, while the back-end diffusion denoising process fully utilizes these conditions to achieve refined iterative optimization of the target bounding boxes. These two processes work collaboratively under a unified training objective, jointly improving the model's overall detection performance for multi-scale ship targets in complex sea conditions, while achieving leading detection accuracy on publicly available datasets. Attached Figure Description

[0043] Figure 1 This is a flowchart illustrating the implementation of the multi-scale SAR image ship detection method of the present invention;

[0044] Figure 2 This is a schematic diagram of the multi-directional gradient adaptive response enhancement operation of differential edge enhancement in the method of the present invention;

[0045] Figure 3 This is a diagram illustrating the involution process of dynamic channel fusion enhancement in the method of this invention;

[0046] Figure 4 This is a schematic diagram of the detection head training and inference process based on the diffusion model in the method of the present invention;

[0047] Figure 5 This is a block diagram of the multi-scale SAR image ship detection system of the present invention;

[0048] Figure 6 This is a comparison chart of the detection results of this invention with those of YOLOv8-n and OptiSAR-Net methods on the SSDD dataset;

[0049] Figure 7 This is a comparison chart of the detection results of this invention with those of YOLOv8-n and OptiSAR-Net methods on the HRSID dataset. Detailed Implementation

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

[0051] It should be noted that the step numbers in the specification and claims of this invention are only for the purpose of clearly describing the embodiments of this invention and facilitating understanding, and their order is not limited.

[0052] Example 1: A multi-scale SAR image ship detection method based on edge enhancement and diffusion denoising

[0053] Reference Figure 1 The implementation steps of this example include the following:

[0054] Step 1, data preprocessing.

[0055] 1.1) Obtain raw SAR images from publicly available ship SAR image datasets as input. These SAR images are usually stored in complex form, and only their amplitude values ​​are taken during actual processing.

[0056] 1.2) To adapt to the input requirements of deep neural networks, the amplitude image is first subjected to logarithmic transformation to compress its high dynamic range and enhance the visibility of weak targets;

[0057] 1.3) Normalize the image pixel values ​​after logarithmic transformation to the preset [0,1] value range, and convert them into an image tensor form that can be processed by deep learning networks;

[0058] 1.4) Based on the standard input specifications of the Detectron2 framework, a standardization operation is performed on the image tensor, namely, subtracting the preset mean and dividing by the preset standard deviation for each channel to obtain the preprocessed SAR image. This standardization operation can effectively align the distribution characteristics of the input data, providing stable and uniform input conditions for subsequent feature extraction.

[0059] Step 2, multi-scale feature extraction.

[0060] 2.1) A deep convolutional neural network with ResNet50 as its backbone was selected:

[0061] The ResNet50 is a classic deep residual network. Its main structure consists of an initial 7×7 convolutional layer, a max pooling layer, and four stacked residual stages, denoted as Stage 2, Stage 3, Stage 4, and Stage 5. Each stage consists of multiple residual blocks. The feature map output by Stage 2 is denoted as res2, the output of Stage 3 as res3, the output of Stage 4 as res4, and the output of Stage 5 as res5. These output feature maps have progressively decreasing spatial resolution and progressively increasing semantic abstraction capabilities.

[0062] 2.2) Input the preprocessed SAR image into the selected deep convolutional neural network for multi-scale feature extraction:

[0063] 2.2.1) The network first performs preliminary downsampling on the input image through an initial 7×7 convolutional layer and a 3×3 max pooling layer with a stride of 2, with a total downsampling factor of 4, to obtain the first-level feature map res2;

[0064] 2.2.2) The first-level feature map res2 is input into the third residual stage Stage 3, which is composed of several stacked residual blocks. The first convolutional layer inside it has a downsampling operation with a stride of 2, so that the resolution of the output feature map is reduced by a factor of 2 based on res2, and finally the second-level feature map res3 with a total downsampling factor of 8 relative to the original input image is obtained.

[0065] 2.2.3) The second-level feature map res3 is input into the fourth residual stage Stage 4. This stage also contains multiple residual blocks. Its first convolutional layer also adopts a downsampling strategy with a stride of 2, which further halves the spatial size and generates a third-level feature map res4 with a total downsampling factor of 16 relative to the original input image.

[0066] 2.2.4) The third-level feature map res4 is input into the fifth residual stage Stage 5. In this stage, downsampling is achieved through convolution operation with a stride of 2. The final output is the fourth-level feature map res5, which has a total downsampling factor of 32 relative to the original input image.

[0067] 2.3) The extracted four feature maps, res2, res3, res4, and res5, are used as the basis for multi-scale representation and are denoted as P2, P3, P4, and P5, respectively. P2 retains rich spatial detail information and is highly sensitive to the edges and textures of small-scale ship targets, making it suitable for precise localization. While P5 has a lower spatial resolution, it contains strong semantic information, which is beneficial for the overall discrimination of large-scale ship targets. These four feature maps together form the input basis for the subsequent dynamic channel fusion enhancement and differential edge enhancement stages.

[0068] Step 3: Perform dynamic channel fusion enhancement on the extracted P2 feature map.

[0069] This step aims to perform content-adaptive feature enhancement and reconstruction on the high-resolution low-level feature map P2 extracted by the deep convolutional neural network. By introducing a dynamic channel fusion operation based on an involution mechanism, spatially specific convolutional kernels are generated, achieving fine-grained modulation of local features and dynamic fusion of channel information. This significantly enhances the weak feature representation capability of small-scale ship targets while preserving rich spatial details, providing high-quality low-level input for subsequent multi-scale feature pyramids. The implementation includes the following:

[0070] 3.1) Select the low-level feature map P2 from the multi-scale feature maps extracted from the deep convolutional neural network;

[0071] 3.2) Generate a set of spatially adaptive convolutional kernels related to spatial location from the low-level feature map P2 through an involution operation:

[0072] Reference Figure 2 The core of this step lies in dynamically generating a dedicated convolutional kernel for each spatial location based on the content of the input feature map, rather than using a globally shared fixed convolutional kernel. This process consists of three steps:

[0073] 3.2.1) Channel Compression and Spatial Context Acquisition:

[0074] First, channel compression is performed on the input low-level feature map P2, with a compression ratio of 2, which halves the number of channels to reduce the complexity of subsequent calculations.

[0075] Next, spatial average pooling is performed on the compressed feature map to obtain its spatial context information over a wider range. The combined effect of these two operations lays the foundation for generating high-quality spatial adaptive convolutional kernels in the future.

[0076] 3.2.2) Generate spatially adaptive convolutional kernels:

[0077] After obtaining the compressed feature map containing contextual information, a spatially adaptive convolutional kernel is generated through a 1×1 convolutional layer. This kernel is a four-dimensional tensor. ,in Given the spatial dimensions of the input feature map P2, The kernel size is the convolution kernel size. The number of groups is given in this example, but is not limited to... The value is 3. The value is 8;

[0078] The key characteristic of this convolution kernel is that at each spatial location Each corresponds to a size of The independent convolutional kernels, whose weights are entirely determined by the feature content surrounding that location, achieve true "content awareness";

[0079] 3.2.3) Local Neighborhood Weighted Aggregation:

[0080] Using the spatial adaptive convolution kernel generated in the previous step Weighted aggregation is performed on the local neighborhood of the original input feature map P2, that is, for each spatial location on the feature map... Using it as the center, first select a size of The local neighborhood is then multiplied element-wise by the convolution kernel corresponding to that position and all pixel values ​​in the neighborhood.

[0081] Then sum the results of element-wise multiplication to obtain the output feature map. Corresponding position Value:

[0082] ,

[0083] in Indicated by Centered on, size is The set of coordinates, Represents the range of summation. Represents the total number of channels. Represents the channel index. Represents spatial location, The number of groups in the channel. Represents the spatial location of the involution operation on the output feature map. At this location, for the neighborhood located at the index And belongs to the channel group The weighted values ​​are calculated by weighting the pixel values. Represents the spatial location of the input feature map Channel Index Pixel value at;

[0084] This weighted aggregation process can adaptively highlight or suppress the feature response of specific regions according to the image content, which is especially beneficial for capturing the fine structure of small targets on ships.

[0085] 3.3) Concatenate the original low-level feature map P2 with the dynamically enhanced features obtained in the previous step along the channel dimension to form a dual-path feature:

[0086] After the involution operation in the previous step, an enhanced feature map with dynamic spatial-channel modulation was obtained. To fully utilize the complete information in the original feature map P2 and inject dynamically enhanced features, this step concatenates the two in the channel dimension. The number of channels in the concatenated feature map is [number missing]. ,in The original P2 channel number forms the so-called "dual-path feature". This design preserves the integrity of the original feature while superimposing dynamically enhanced information, providing richer input for subsequent fusion.

[0087] 3.4) Perform channel compression and nonlinear transformation on the spliced ​​dual-channel features to output the final dynamic channel fusion enhanced features. :

[0088] 3.4.1) Reduce the number of channels in the dual-path feature from Compress to :

[0089] To ensure the final output feature map maintains the same channel count as subsequent layers of the backbone network and to reduce redundant information, this step first performs channel compression on the concatenated dual-path features. Specifically, this is achieved by using a 1×1 convolutional layer to compress the number of channels from... Compress back to the original number of channels This operation can be viewed as a feature fusion, which integrates dual-path information into a compact and efficient representation, laying the foundation for subsequent nonlinear transformations.

[0090] 3.4.2) Standardize the compressed features:

[0091] The number of channels obtained in the previous step has been compressed to Batch normalization is applied to the feature maps to achieve standardization, that is, the mean and variance of each batch of data are normalized to stabilize the internal covariate shift during network training, thereby accelerating model convergence and improving generalization ability.

[0092] 3.4.3) Introduce nonlinearity and generate the final feature map:

[0093] After batch normalization, a ReLU activation function is applied to the normalized feature map to introduce nonlinearity. This allows the network to learn complex feature mapping relationships while simplifying computation and mitigating the gradient vanishing problem. Through this operation, the normalized feature map is transformed into the final dynamic channel fusion enhanced feature map, denoted as... ;

[0094] At this point, the dynamic channel fusion enhancement process is complete. This will serve as a high-quality bottom-level feature, which, together with the enhanced mid-to-high-level feature maps in subsequent steps, will form a complete multi-scale feature pyramid, providing support for the diffusion model detection head and enabling accurate ship target localization and classification.

[0095] Step 4: Perform differential edge enhancement on the P3–P5 feature maps extracted in Step 2.

[0096] This step aims to introduce differential edge enhancement processing for the mid-to-high-level feature maps P3, P4, and P5 extracted from the backbone network, explicitly amplifying the difference between the ship target edge and background noise. The core idea of ​​this step is to leverage the physical difference between the local self-similarity of multiplicative speckle noise in SAR images and the anisotropy of ship target edges. By calculating the difference between pixels, useful signals are enhanced and interference noise is suppressed, thereby significantly improving the signal-to-noise ratio and edge discrimination capability of the mid-to-high-level feature maps. Its implementation includes the following:

[0097] 4.1) Select mid-to-high-level feature maps P3, P4, and P5 from the multi-scale feature maps extracted from the deep convolutional neural network. These feature maps correspond to the feature maps of the original SAR image downsampled by 8, 16, and 32 times, respectively. They contain strong semantic information, but have low spatial resolution and are easily affected by multiplicative speckle noise. Therefore, in this step, feature maps P3, P4, and P5 are selected as input and subjected to special edge enhancement processing.

[0098] 4.2) Construct a set of pixel pairs:

[0099] For each mid-to-high-level feature map, such as P3, at each spatial location, take that location as the center pixel. Take a size of Local receptive field area Subsequently, a network consisting of a central pixel is constructed. With all neighboring pixels The set of pixel pairs:

[0100] ,

[0101] in This represents the set of indices of all neighboring pixels within the local receptive field region, whose number of elements satisfies , The kernel size is [value]. In this example, the kernel size is [value]. The value is set to 3, so each center pixel will form a pixel pair with its 8 neighboring pixels.

[0102] 4.3) Calculate the local difference response:

[0103] Reference Figure 3 This step is based on the above set of pixel pairs. The local contrast adaptive differential enhancement method is used to calculate the differential response of each pixel. By analyzing the relative difference distribution between all pixel pairs in the local neighborhood, the enhanced response is dynamically generated.

[0104] For each spatial location and channel index First, calculate the center pixel. With each neighboring pixel The absolute difference between them:

[0105]

[0106] Subsequently, the mean of the local differences among all differences within this local neighborhood is calculated. : Then calculate the standard deviation of all differences within this local neighborhood. : Next, the local difference enhancement response is calculated:

[0107] ,

[0108] in The enhancement coefficient is used to control the sensitivity to local difference fluctuations. Through this combination of multi-directional gradient analysis, statistical characteristic adaptive weights and nonlinear enhancement functions, the accurate capture of edge features and effective suppression of noise can be achieved.

[0109] 4.4) Generate the final enhanced feature map:

[0110] After obtaining the differential enhancement response map Then, this step compares it with the original input feature map. P3, P4, and P5 are weighted and fused using residual connections to obtain the final enhanced feature map. :

[0111] ,

[0112] in, It is a learnable scalar parameter generated after activation by the Sigmoid function, used to dynamically balance the residual enhancement term. Compared with the original feature terms Contribution ratio: when When the value is close to 1, the model tends to emphasize edges; when... When the value is close to 0, the model tends to retain the original features. This dynamic balancing mechanism ensures that while suppressing noise, the original semantic information is not excessively destroyed.

[0113] 4.5) Constructing the complete feature pyramid:

[0114] The three mid-to-high-level feature maps P3, P4, and P5, which have undergone the above processing to enhance edge information and suppress noise, are fused with the dynamic channel output from step 3 to enhance the feature map. The features are then stitched together to form a complete, high-quality multi-scale enhanced feature pyramid. This pyramid will serve as the input to the subsequent diffusion model's detection head, providing it with strong semantic and robust conditional guidance, thereby achieving accurate ship target localization and classification.

[0115] Step 5: Train the diffusion model detection head.

[0116] Reference Figure 4 The first half of this step includes the following:

[0117] 5.1) Constructing noisy training samples:

[0118] 5.1.1) For each SAR image to be trained, obtain the set of real ship target bounding boxes from its annotation information. : ,

[0119] in, Represents the bounding box of each real-world ship target. and The normalized x-coordinate and y-coordinate of the ship target in the image coordinate system. The width of the ship target after normalization. The height of the ship target after normalization;

[0120] 5.1.2) Random sampling time step:

[0121] After obtaining the ground truth bounding box, start from the preset time step sequence. Randomly sample a time step In this example, the total number of time steps Set it to 1000 to provide a sufficiently fine iterative space for subsequent reverse denoising;

[0122] 5.1.3) Add Gaussian noise:

[0123] After determining the time step Then, following the cosine noise scheduling strategy, Gaussian noise was added to all real bounding boxes. This results in a set containing multiple noise boxes. ,in The calculation method is as follows:

[0124]

[0125] in, Indicates the time step from the initial moment. The cumulative variance coefficient, ,

[0126] It is a random noise vector that follows a standard normal distribution, and its dimensions are the same as those of the bounding box.

[0127] A predefined noise scheduling sequence is used to control the intensity of noise added at each time step;

[0128] 5.2) Extracting conditional features:

[0129] 5.2.1) For each noisy bounding box generated in 5.1), Perform region alignment operation, based on The bounding box coordinates are used to crop out the corresponding rectangular region on the multi-scale feature pyramid obtained in steps 2 and 3.

[0130] 5.2.2) Using bilinear interpolation, all cropped regions are scaled to a fixed size, such as 7×7 pixels, to obtain a region-level feature vector with fixed dimensions corresponding to the position of the noise box;

[0131] 5.2.3) Constructing the time-step embedding vector:

[0132] In order for the diffusion detection head to be able to sense the current denoising stage, a small fully connected network or sinusoidal position encoding is used to encode the current time step. Constructing a time-step embedding vector, its core function is to index discrete time steps. This step of converting the vector into a continuous vector that matches the feature dimension is crucial for adapting to the temporal characteristics of the diffusion model. It enables the detection head to adjust its internal attention weights and prediction behavior according to the characteristics of different time steps.

[0133] 5.2.4) Combine regional features with time step embeddings to form the final input:

[0134] The extracted regional feature vectors are concatenated or added to the time step embedding vectors to form a complete conditional input vector containing spatial location information and temporal context information. This vector is then fed into the dynamic interaction module of the diffusion detection head to drive it to predict the category confidence and noise components.

[0135] 5.3) Forward prediction and loss calculation of the detection head:

[0136] The multi-layered dynamic interaction module of the diffusion detection head transforms input features into predictions of target category and noise, and guides the optimization of model parameters through a comprehensive loss function. The specific implementation of this process includes the following:

[0137] 5.3.1) Perform forward propagation and output the prediction results:

[0138] The diffusion detection head receives the input features generated in 5.2) and feeds them into its internal multi-layered dynamic interaction module. This module consists of several cascaded dynamic attention layers, each containing a self-attention unit, a dynamic cross-attention unit, and a feedforward network (FFN) submodule. These submodules work together to achieve the following functions:

[0139] Self-attention unit: used to model the interdependencies between different proposal boxes, enabling the model to understand the spatial layout of multiple objects in an image;

[0140] Dynamic cross-attention unit: used to adaptively extract the semantic context information most relevant to each proposal box from the fused multi-scale features, thereby improving the accuracy of prediction;

[0141] Feedforward Network (FFN): Used to perform nonlinear transformations on the fused features to enhance the expressive power of the model.

[0142] Through the above interactive operations, the detection head ultimately predicts the category confidence level. and prediction noise These two key outputs, of which:

[0143] Category confidence : Indicates the probability distribution of the noise box belonging to each category at the current time step.

[0144] Predicted noise This is the core objective of model learning: predicting from noisy boxes. Return to the real frame The required amount of correction.

[0145] 5.3.2) Establish a one-to-one matching relationship between predicted bounding boxes and ground truth bounding boxes:

[0146] Obtain the set of predicted bounding boxes and their corresponding class confidences output in step 5.3.1), combine them with the set of real ship target bounding boxes and their class labels corresponding to the current training image, call the Hungarian matching algorithm, and calculate the matching cost matrix based on the classification score and geometric overlap (IoU) between the predicted boxes and the real boxes.

[0147] Based on this cost matrix, the optimal bipartite graph matching is solved, and a unique matching ground truth box is assigned to each predicted box, or it is marked as background, thereby establishing a one-to-one supervised correspondence between the prediction results and the ground truth labels.

[0148] 5.3.3) Calculate the weighted total loss:

[0149] Based on the one-to-one matching relationship established in step 5.3.2), for each successfully matched prediction box, extract its corresponding category confidence score. With predicted noise components and the real category label that matches it. Adding noise to reality Supervisory pairs are constructed, and loss is calculated based on these supervisory pairs. The loss function is... Classification loss With bounding box regression loss It consists of two parts, and its design is as follows:

[0150] First, based on the confidence level of the target category The difference between the actual class label and the true class label is used to calculate the classification loss. :

[0151] ,

[0152] in, It is the first The true category label of the target It is the model's prediction of the first The probability distribution of each target belonging to each category;

[0153] Secondly, according to L1 loss Compared with generalized IoU loss Calculate the bounding box regression loss :

[0154]

[0155] in, The weighting coefficients for L1 regression loss are... These are the weighting coefficients for the generalized IoU regression loss.

[0156] The formula for calculating L1 loss is as follows: ,here These represent the four dimensions of the predicted bounding box. The four dimensions represent the true bounding box values;

[0157] Generalized IoU loss Loss is calculated using the overlap between the predicted bounding box and the ground truth bounding box, and their minimum bounding rectangle. ,in, The calculation formula is , and These refer to the prediction boxes. and real frame The area block, represent and The overlapping area It refers to and The minimum bounding rectangle;

[0158] Ultimately, based on classification loss and bounding box regression loss Obtain the loss function :

[0159]

[0160] in, These are the classification loss weight coefficients. The weighting coefficients for L1 regression loss are... These are the weighting coefficients for the generalized IoU regression loss. These three weighting coefficients are used to control the proportion of contribution to the total loss. By minimizing the above loss, the diffusion detection head learns to gradually recover the true target box and its category from arbitrary noise distribution.

[0161] 5.3.4) Perform backpropagation and update network parameters:

[0162] Based on the total loss value To optimize the target, the automatic differentiation engine is invoked to calculate the gradient of the loss function with respect to all learnable parameters in the diffusion model's detection head. Subsequently, a gradient descent-based optimizer, such as AdamW, is used to perform a parameter update operation on the network parameters of the detection head based on the calculated gradient. This enables the model to output a prediction result that is closer to the real target in the next forward propagation, thus completing a full training iteration.

[0163] 5.4) Training Termination Determination

[0164] Repeat steps 5.1) to 5.3) until either of the following termination conditions is met: First, the average precision mAP of the model on the validation set or the average precision AP50 index at an IoU threshold of 0.5 reaches a preset threshold; Second, the total number of training iterations reaches a preset upper limit, and the trained diffusion model detection head is obtained.

[0165] Step 6: Use the trained diffusion model detection head to perform inference detection.

[0166] Given a SAR image containing ship targets, the inference stage requires no real-world annotation information. It relies solely on the model's iterative denoising capabilities to gradually "cleanse" and converge accurate ship target bounding boxes and their ship category confidence scores from a completely random noise distribution. (Refer to...) Figure 4 The second half of this step includes the following:

[0167] 6.1) Generate initial random noise boxes:

[0168] First, a set of [number] data points is generated from the SAR image to be detected, which contains ship targets. A set of random Gaussian noise boxes The coordinate values ​​of these boxes follow a standard normal distribution, and their representation is consistent with that of the training phase, namely the normalized center coordinates and width and height.

[0169] 6.2) Perform iterative denoising sampling:

[0170] After obtaining the initial noise box, the DDIM sampling algorithm is used to carry out an iterative denoising process to obtain high-quality denoising results in a smaller number of iterations.

[0171] Specifically, the algorithm will follow a preset time step sequence. Sampling one time step For example, from the first Step 0, and perform the following operations in sequence:

[0172] 6.2.1) Feature Extraction:

[0173] The noise box set at the current time step is aligned with the multi-scale feature pyramid after differential edge enhancement and dynamic channel fusion enhancement. Local region features corresponding to each noise box are cropped from the feature maps of each layer and scaled to a fixed size to form a set of region-level feature vectors.

[0174] 6.2.2) Perform forward propagation and output the prediction results:

[0175] Combine the aforementioned regional feature vectors with the current time step The embedded information is input together with the pre-trained diffusion detection head. The detection head predicts the prediction noise through its internal multi-layer dynamic attention network. and prediction categories These two key outputs predict noise. It refers to the noise portions that the model believes should be removed from the current set of noise boxes; the predicted category. It is the model's confidence estimate of the category to which the current noise box belongs;

[0176] 6.2.3) Box coordinate update:

[0177] Using the predicted noise By combining the diffusion scheduling parameters at the current time step and using the inverse formula of the diffusion model, the updated bounding box coordinates for the next time step are calculated, resulting in the next "cleaner" bounding box. :

[0178] ,

[0179] in, It is an additional Gaussian noise term used to increase diversity. Determined by the scheduling table;

[0180] 6.2.4) Box Filtering and Supplementation:

[0181] The updated bounding boxes obtained in 6.2.3) are filtered according to their corresponding ship category confidence scores. Boxes with confidence scores higher than a preset threshold, such as 0.5, are retained, and redundant boxes with low confidence scores are removed. Subsequently, in order to keep the total number of boxes constant, a corresponding number of new random noise boxes are added from the Gaussian distribution to form the input box set for the next iteration step, until the iterative denoising process completes all preset steps.

[0182] 6.3) Output of reasoning results:

[0183] When the iterative denoising process described in step 6.2) completes all the preset number of steps, that is, when the time step is reached... At that time, the diffusion model detection head outputs a set of final ship target bounding boxes and their corresponding category confidence scores, which serve as the preliminary ship detection results for the current SAR image to be detected.

[0184] Step 7: Post-processing of the reasoning results.

[0185] This step further processes the preliminary ship detection results output in step 6, and outputs the precise bounding box coordinates and class confidence scores of the ship targets in the image as follows:

[0186] 7.1) Perform Non-Maximum Suppression (NMS):

[0187] Based on the set of ship target bounding boxes and their category confidence scores output in step 6, calculate the intersection-union ratio (IoU) between any two predicted boxes; for overlapping box groups with an IoU higher than a preset threshold, such as 0.5, retain only the predicted box with the highest category confidence score and discard the rest to eliminate duplicate detection.

[0188] 7.2) Perform coordinate inverse normalization and result formatting:

[0189] The ship target bounding box coordinates processed by 7.1) NMS are converted from normalized form back to the pixel coordinate format of the original SAR image; at the same time, each ship target bounding box is bound to its corresponding category label to form a structured detection result.

[0190] 7.3) Generate the final ship inspection result list:

[0191] All formatted ship detection results are aggregated into a ship detection result list, where each record contains the precise bounding box coordinates and class confidence of a ship target. This list serves as the final output of the method in this example, completing the full ship target detection task on the input SAR image.

[0192] Example 2: Multi-scale SAR image ship detection system based on edge enhancement and diffusion denoising

[0193] Reference Figure 5 This example includes: a data preprocessing module 1, a multi-scale feature extraction module 2, a dynamic channel fusion enhancement module 3, a differential edge enhancement module 4, a diffusion model detection head module 5, and an output module 6. Among them:

[0194] The dynamic channel fusion enhancement module 3 includes a feature input submodule 31, an involution kernel generation submodule 32, a dynamic feature modulation submodule 33, and a dual-path feature fusion submodule 34;

[0195] The differential edge enhancement module 4 includes a feature input submodule 41, a local differential response enhancement submodule 42, a residual fusion submodule 43, and an enhanced feature output submodule 44.

[0196] The diffusion model detection head module 5 includes a region feature alignment submodule 51, a time step embedding submodule 52, a dynamic interactive decoding submodule 53, and a prediction output submodule 54.

[0197] The working principle of the entire system is as follows:

[0198] The data preprocessing module 1 is used to receive the original SAR image as system input. The module first performs a logarithmic transformation on the amplitude value of the input image to compress its high dynamic range. Then, it normalizes the transformed pixel values ​​to a preset numerical range, such as [0,1]. Finally, it converts the normalized image into an image tensor, subtracts the preset mean from each channel, divides it by the preset standard deviation, completes the standardization process, and then sends the processed and standardized SAR image data as output to the multi-scale feature extraction module 2.

[0199] The multi-scale feature extraction module 2 is used to receive standardized SAR image data from the data preprocessing module 1. It uses a deep convolutional neural network with ResNet50 as the backbone to extract features from the input image. Then, it selects the first four high-resolution feature maps P2, P3, P4, and P5 as outputs and sends the first feature map P2 as output to the dynamic channel fusion enhancement module 3. At the same time, it sends the three feature maps P3, P4, and P5 as outputs to the differential edge enhancement module 4, thereby providing multi-scale basic input for the subsequent feature enhancement stage.

[0200] The dynamic channel fusion enhancement module 3 is used to perform spatial adaptive fusion of the low-level feature maps sent by module 2. Specifically: the feature input submodule 31 receives the low-level feature map P2 from the multi-scale feature extraction module 2 and outputs it to the involution kernel generation submodule 32, the dynamic feature modulation submodule 33, and the dual-path feature fusion submodule 34, respectively; the involution kernel generation submodule 32 sequentially performs channel compression and spatial average pooling operations on the low-level feature map P2 from the feature input submodule 31, and generates a set of spatially adaptive convolution kernels related to spatial location through a 1×1 convolutional layer, then sends the generated spatially adaptive convolution kernels to the dynamic feature modulation submodule 34. 3. The dynamic feature modulation submodule 33 uses a spatially adaptive convolutional kernel from the involution kernel generation submodule 32 to perform weighted aggregation on the local neighborhood of the low-level feature map P2 from the feature input submodule 31, outputting the enhanced feature after dynamic spatial-channel modulation, and sending the enhanced feature to the dual-path feature fusion submodule 34; the dual-path feature fusion submodule 34 concatenates the original low-level feature map P2 from the feature input submodule 31 and the enhanced feature from the dynamic feature modulation submodule 33 in the channel dimension to form a dual-path feature representation, and performs 1×1 convolutional channel compression, batch normalization and ReLU activation operations on the concatenated feature in sequence, finally outputting the dynamic channel fusion enhanced feature. Provide the diffusion model detection head module 5;

[0201] The differential edge enhancement module 4 is used to enhance edge features and suppress noise in the enhanced mid-to-high-level feature maps sent by the multi-scale feature extraction module 2. Specifically: the feature input submodule 41 is used to independently input the multi-scale feature maps P3, P4, and P5 sent by the multi-scale feature extraction module 2 to the local differential response enhancement submodule 42; the local differential response enhancement submodule 42 independently performs local contrast adaptive differential enhancement operations on the three feature maps P3, P4, and P5 from the feature input submodule 41: at each spatial location, it calculates the absolute difference between the center pixel and all pixels in its neighborhood; subsequently, based on the mean and standard deviation of the local region difference, it dynamically generates an enhancement response, forming a residual feature map. , and Finally, these three sets of residual features are sent to the learnable residual fusion submodule 43; the learnable residual fusion submodule 43 processes the residual features from the local difference response enhancement submodule 42. , and In addition, a learnable scalar parameter is introduced from feature maps P3, P4, and P5 from feature input submodule 41. ,in After activation by the Sigmoid function, gated weights are obtained. These residual features are then weighted and fused with the original features to output the enhanced mid-to-high-level feature map. , and The three sets of enhanced features are then sent to the enhanced feature output submodule 44; the enhanced feature output submodule 44 then sends the enhanced features from the learnable residual fusion submodule 43 to the enhanced feature output submodule 43. , and Enhanced features from Dynamic Channel Fusion Enhancement Module 3 The features are then merged to form a complete multi-scale enhanced feature pyramid. This feature pyramid is then sent to the subsequent diffusion model detection head module 5 for region feature alignment and iterative denoising detection.

[0202] The diffusion model detection head module 5 is used to perform region feature extraction on the bounding box proposals at each iteration time step on the multi-scale enhanced feature pyramid, and predict the class confidence and noise components to be removed for each proposal box through a multi-layer dynamic attention mechanism. This module learns the mapping relationship from noise boxes to real target boxes during the training phase, and iteratively optimizes the bounding boxes through denoising during the inference phase, finally outputting the prediction results to the output module 6. The region feature alignment submodule 51, based on the current iteration time step... The bounding box proposal coordinate region is used to perform region alignment on the multi-scale enhanced feature pyramid jointly formed by the differential edge enhancement module 4 and the dynamic channel fusion enhancement module 3, extracting the region-level features corresponding to each proposal box and sending them to the dynamic interactive decoding submodule 53; the time step embedding submodule 52 indexes the current iteration time step. The time-aware vector is encoded and aligned with the dimension of the region features, and this time-step embedding vector is sent to the dynamic interactive decoding submodule 53. The dynamic interactive decoding submodule 53 receives the region-level features from the region feature alignment submodule 51 and the time-step embedding vector from the time-step embedding submodule 52, and performs fusion processing on the two through a multi-layered cascaded dynamic attention layer, outputting the fused high-dimensional feature representation, and sending it to the prediction output submodule 54. The prediction output submodule 54 uses the fused features from the dynamic interactive decoding submodule 53 to predict the class confidence and noise components to be removed for each current bounding box proposal. These prediction results are used to update the bounding box coordinates during the iterative denoising process, and at the end of the inference process, the bounding box coordinates and class confidence of the final iteration step are sent to the output module 6.

[0203] The output module 6 is used to further process the bounding box set and its category confidence scores output by the diffusion model detection head module 5 in the final iteration step of the inference stage to obtain the final output result of the system. First, all predicted boxes are filtered by score based on category confidence scores, and low-quality predictions with confidence scores below a preset threshold are removed. Then, non-maximum suppression (NMS) is performed on the filtered predicted boxes. For overlapping box groups with an intersection-union ratio (IoU) higher than a preset threshold, only the bounding box with the highest category confidence score is retained. Finally, the bounding box coordinates are converted from normalized format to original image pixel coordinates and bound to the corresponding category label to form a detection result containing the final ship target category and accurate bounding box coordinates, which is the final output of this system.

[0204] It should be noted that the above-mentioned functional modules can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented entirely or partially in the form of program instruction products. A program instruction product includes one or a set of program instructions. When the program instructions are loaded and executed on a computer, the process or function is generated entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Program instructions can be stored in a computer-readable and writable storage medium, or transferred from one computer-readable and writable storage medium to another. Direct coupling or communication connections between modules can be achieved through indirect coupling or communication connections through interfaces, devices, or modules. In this embodiment, the functional modules and sub-modules can dynamically reside within a processing unit, or each module can exist physically separately, or two or more modules can dynamically reside within a processing unit. When these dynamic components are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable and writable storage medium. This storage medium can be a memory, a disk, or an optical disk, etc.

[0205] The effects of the present invention will be further explained below with reference to specific experiments.

[0206] I. Simulation Experiment Conditions

[0207] 1. Experimental environment configuration:

[0208] The hardware platform for this experiment was a high-performance computing workstation equipped with dual NVIDIA RTX 4090 graphics cards, each with 24GB of VRAM, an Intel Xeon Platinum 8360Y CPU, and 128GB of RAM. The software environment consisted of an Ubuntu 20.04LTS operating system, CUDA 12.2 and cuDNN 9.1.0 acceleration libraries, the PyTorch 2.6.0 deep learning framework, and implementation based on the Detectron2 0.6 object detection library, using Python 3.11.11 as the programming language.

[0209] 2. Dataset:

[0210] The experiment used two representative public SAR ship detection datasets: SSDD and HRSID.

[0211] 1) SSDD dataset: Contains 1160 images with a total of 2456 ship instances, covering various resolutions, polarization modes and sea state scenarios, suitable for verifying the generalization ability of the model under diverse conditions;

[0212] 2) HRSID dataset: Contains 5604 high-resolution SAR images with a total of 16951 ship instances. It includes challenging scenarios with complex backgrounds and dense targets, such as nearshore and port areas, and is suitable for testing the model's detection performance in complex environments and small targets.

[0213] 3. Evaluation indicators:

[0214] The experiment uses the average accuracy metric widely used in the field of target detection:

[0215] 1) AP50: This metric characterizes the average detection accuracy of the model when the Intersection over Union (IoU) threshold is 0.5, and is a fundamental evaluation standard in the field of target detection. AP50 allows for a moderate localization deviation between the detected bounding box and the ground truth bounding box. An IoU ≥ 0.5 is considered correct. It is suitable for scenarios in SAR images where the boundary localization requirements are relatively relaxed due to blurred or irregular target edges, and can effectively reflect the model's basic ability to discriminate the existence of targets.

[0216] 2) mAP: This metric calculates the average accuracy across 10 intervals (0.05 to 0.95) with IoU thresholds ranging from 0.5 to 0.95, and then averages the AP across all categories to comprehensively evaluate the model's robustness under different positioning accuracy requirements. Compared to AP50, mAP sets a higher standard for the geometric consistency of detection boxes, making it particularly suitable for scenarios with complex marine background interference and dense distribution of multi-scale targets. It comprehensively reveals the model's performance in fine-grained positioning, resistance to false alarms, and resistance to missed detections, and is a key indicator for measuring the algorithm's overall generalization ability.

[0217] II. Simulation Experiment Content

[0218] Simulation 1: Under the above simulation conditions, the present invention and the current mainstream one-stage detector methods YOLOv8-n, YOLOv5-n, YOLOv9-t, YOLOv10-n, YOLOX-t and RTMDet-t were respectively used to detect ship targets on the SSDD dataset, and the bounding boxes of each target were output. All methods adopted the same training set / test set partitioning, image input resolution and data augmentation strategy. The accuracy was compared with AP50 and mAP as evaluation indicators. The results are shown in Table 1.

[0219] Table 1. Comparison of ship detection accuracy between the present invention and the first-stage detector on the SSDD dataset.

[0220]

[0221] As can be seen from the experimental results in Table 1, on the SSDD dataset, the AP50 of this invention is 98.9% and the mAP is 74.9%, both of which are superior to all the comparison methods.

[0222] Simulation 2: Under the same experimental conditions as Simulation 1, the present invention and the current mainstream two-stage detector Faster R-CNN were used to detect ship targets on the HRSID dataset. The accuracy of the two detectors was compared, and the experimental results are shown in Table 2.

[0223] Table 2 Comparison of ship detection accuracy between the present invention and the two-stage detector on the HRSID dataset.

[0224]

[0225] As shown in Table 2, on the HRSID dataset, the mAP of this invention is 68.9%, which is 13.7 percentage points higher than Faster R-CNN's 55.2%, and also 17.0 percentage points higher than Faster R-CNN's AP50.

[0226] Simulation 3, under the same experimental conditions as Simulation 1, uses the present invention and the current mainstream SAR-specific detection methods SA-YOLOv5-Plus and OptiSAR-Net to detect ship targets on the SSDD dataset, and compares their detection accuracy. The experimental results are shown in Table 3.

[0227] Table 3. Comparison of ship detection accuracy between the present invention and the SAR-specific method on the SSDD dataset.

[0228]

[0229] As shown in Table 3, on the SSDD dataset, the AP50 index of this invention is as high as 98.9%, which is better than the two mainstream SAR target detection methods. The mAP index of this invention is as high as 74.9%, which is also significantly higher than the two mainstream SAR target detection methods, verifying the leading performance of this invention in SAR-specific scenarios.

[0230] Simulation 4: Using the methods of this invention and existing methods YOLOv8-n and OptiSAR-Net on the SSDD dataset, ship target detection was performed in three typical scenarios: small target ships on the sea surface, complex backgrounds, and multiple targets in the open sea. Visual comparisons were then performed. All methods were run on the same test samples, with consistent input images and processing parameters. The visualized experimental results are attached. Figure 6 As shown. Wherein:

[0231] Figure 6 (a) The bounding boxes of real ship targets manually annotated in three scenarios serve as the evaluation benchmark;

[0232] Figure 6 (b) The ship target detection results of the existing YOLOv8-n method in three scenarios;

[0233] Figure 6 (c) The ship target detection results of the existing OptiSAR-Net method in three scenarios;

[0234] Figure 6 (d) shows the ship target detection results of the present invention in three scenarios.

[0235] From the appendix Figure 6 It can be seen intuitively that, with Figure 6 (a) shows the actual annotations as a reference. Figure 6 (b) The YOLOv8-n method misdetected the ship target in the upper left corner in the first small target scene image at sea, misdetected the bow of the ship as an independent target in the second scene image, and missed 5 targets in the third multi-target scene image at sea. Figure 6(c) The OptiSAR-Net method also missed the ship target in the upper left corner in the first scene image, falsely detected the bow in the second scene image, and missed 5 targets in the third scene image; while Figure 6 (d) The method of the present invention accurately detected all real targets in all three scenarios without any missed or false detections.

[0236] Simulation 5 demonstrates the detection of ship targets on the HRSID dataset using the methods of this invention and existing methods YOLOv8-n and OptiSAR-Net, targeting three typical scenarios: small target ships on the sea surface, densely packed ships in ports, and multiple targets in the open sea. Visual comparisons are then performed. All methods are run on the same test samples, with consistent input images and processing parameters. The visualized experimental results are attached. Figure 7 As shown. Wherein:

[0237] Figure 7 (a) The bounding boxes of real ship targets manually annotated in three scenarios serve as the evaluation benchmark;

[0238] Figure 7 (b) The ship target detection results of the existing YOLOv8-n method in three scenarios;

[0239] Figure 7 (c) The ship target detection results of the existing OptiSAR-Net method in three scenarios;

[0240] Figure 7 (d) shows the ship target detection results of the present invention in three scenarios.

[0241] From the appendix Figure 7 It can be seen intuitively that, with Figure 7 (a) shows the actual annotations as a reference. Figure 7 (b) The YOLOv8-n method misdetects background noise as a target in the first small target scene image at sea, merges dozens of ships into a single large target and misses several small boats in the second scene image, and misses 3 targets in the third multi-target scene image at the open sea. Figure 7 (c) The OptiSAR-Net method misses a small target ship on the left in the first scene image, misses a ship in a dense area in the second scene image, and misses one target in the third scene image; while Figure 7 (d) The method of the present invention showed that only one minor omission occurred in the edge region of the second scene image, and all real targets were accurately detected in all other scenes without any missed or false detections.

[0242] The simulation results above show that the present invention has higher detection accuracy, lower false negative rate and better stability compared with the existing technology in multi-scenario SAR ship target detection tasks.

Claims

1. A multi-scale SAR image ship detection method based on edge enhancement and diffusion denoising, characterized in that, Comprise: (1) input SAR image and standardize preprocessing, obtain the SAR image data to be detected; (2) the SAR image to be detected is input into the deep convolutional neural network, and the multi-scale feature map is extracted; (3) the low layer feature map in the multi-scale feature map is dynamically fused and enhanced, and the fused high quality feature map is obtained; (4) the middle and high layer feature map in the multi-scale feature map is differentially enhanced, and the enhanced high quality feature map is obtained; (5) the enhanced feature map and the fused feature map are input into the diffusion model detection head, and the training is carried out; (6) the SAR image to be detected is input into the trained diffusion model detection head, the iterative denoising inference is executed, and the preliminary target bounding box and class confidence are output; (7) the preliminary detection result is post-processed, including score screening and non-maximum suppression operation, and the final ship target detection result is generated.

2. The method of claim 1, wherein: the SAR image is standardized in the (1) preprocessing: 1a) the amplitude value of the original SAR image is logarithmically transformed to compress the dynamic range; 1b) the pixel value of the transformed image is normalized to a preset value interval; 1c) the normalized image tensor is subtracted by a preset mean value and then divided by a preset standard deviation to complete the standardization processing; the SAR image to be detected is input into the deep convolutional neural network in the (2) to extract the multi-scale feature map, comprising: 2a) the SAR image after standardization preprocessing is input into the deep convolutional neural network with ResNet50 as the backbone, and five layers of feature maps res2, res3, res4, res5 and res6 are output; 2b) the first four high-resolution feature maps are selected as the extracted multi-scale feature maps, and are denoted as P2, P3, P4 and P5 respectively, and the corresponding spatial downsampling multiples are 4, 8, 16 and 32 respectively; the low layer feature map P2 is selected from the multi-scale feature map extracted from the deep convolutional neural network in the (3) dynamic channel fusion enhancement, comprising: 3a) the low layer feature map P2 is selected from the multi-scale feature map extracted from the deep convolutional neural network; 3b) the low layer feature map P2 is generated by inner convolution operation to generate a group of spatial adaptive convolution kernels related to spatial position: 3b1) the input low layer feature P2 is compressed by channel compression with a compression ratio of 2 to reduce the calculation complexity; 3b2) spatial average pooling operation is performed on the feature map after channel compression to obtain its spatial context information; 3d) the low layer feature map P2 and the dynamic enhanced feature output in step 3c) are spliced in the channel dimension to obtain a double channel feature representation; 3e) the spliced double channel feature is compressed by a 1x1 convolutional layer, the channel number is compressed from 2C to C, and batch normalization and ReLU activation functions are sequentially applied, and the final dynamic channel fusion enhanced feature is output; the middle and high layer feature maps P3, P4 and P5 are selected from the multi-scale feature map extracted from the deep convolutional neural network in the (4) differential edge enhancement, comprising: 4a) the middle and high layer feature maps P3, P4 and P5 are selected from the multi-scale feature map extracted from the deep convolutional neural network; ​ ​ ​ ​ ​ ​ ​ 3. The method of claim 1, wherein, ​ ​ ​ ​ ​ 3b3) the spatially averaged pooled feature map is further generated into a spatial adaptive convolution kernel through 1x1 convolution wherein is the size of the input feature map, is the size of the convolution kernel, is the number of groups; 3c) using the spatially adaptive convolution kernel generated in step 3b), performing a weighted aggregation of the local neighborhood of P2, resulting in a dynamic enhancement feature, each spatial position in the feature is calculated as follows: , wherein represents a set of coordinates centered at with size , i.e. the local neighborhood covered by the convolution kernel; ​ ​ 4. The method of claim 1, wherein, ​ ​ 4b) For each mid-high layer feature map, take a local receptive field region at each spatial position of it , construct a pixel pair set consisting of the center pixel and each neighbor pixel : where denotes the index set of all neighbor pixels within the local receptive field region, whose element number satisfies , is the kernel size. 4c) Based on the set of pixel pairs, generate a differential enhanced feature map with the same size as the input feature map by computing the absolute difference value of the center pixel and the neighborhood pixels, and according to the mean and standard deviation of the local area difference value The mathematical expression is: , wherein denotes the difference enhancement value computed at spatial position , channel index , is the average value of the difference values of all pixels within a local region centered at position ; is the standard deviation of the difference values within this region; is an enhancement coefficient for controlling the sensitivity to local difference fluctuations; 4d) the differential enhanced feature map generated in step 4c) with the original input feature map weighted fusion by residual connection, to obtain the final enhanced output feature map : , wherein, is a learnable scalar parameter, activated by a sigmoid function, to dynamically balance the contribution of the residual enhancement term and the original feature term. 4e) The mid-high layer feature map obtained after the above processing is spliced with the feature map obtained after dynamic channel fusion enhancement to form a complete multi-scale enhanced feature pyramid for subsequent regional feature alignment and iterative denoising detection of the diffusion model detection head.

5. The method of claim 1, wherein, The diffusion model detection head in (5) is a lightweight detection network based on a dynamic attention mechanism, including: a dynamic feature projection layer, a lightweight dynamic attention detection decoder, and a prediction output layer. The dynamic feature projection layer: receives and fuses the multi-scale feature map and the time step information of the diffusion process, projects the time step embedding vector into a modulation weight, dynamically modulates the input features, and makes the feature representation adapt to different denoising stages. The lightweight dynamic attention detection decoder: is composed of multiple cascaded decoding layers, each decoding layer includes a self-attention module, a dynamic cross-attention module, and a feedforward network; the self-attention module is used to establish the interaction relationship between different proposal boxes, the dynamic cross-attention module is used to dynamically extract the most relevant context information from the modulated multi-scale features for each proposal box, and the feedforward network is composed of two linear layers and an activation function for further processing of the fused features. The prediction output layer: receives the output of the last layer of the decoder, and predicts the coordinate offset of the bounding box through two parallel linear projection heads a probability distribution of the target class wherein, is the number of proposals, is the number of classes.

6. The method of claim 1, wherein, The diffusion model detection head in (5) is trained, including: 5a) A set of ground truth bounding boxes for each input SAR image , a forward diffusion process is performed to obtain noisy bounding boxes : 5a1 ) randomly sampling one time step from a pre-set time step range; 5a2) adding Gaussian noise to the ground truth box according to the cosine schedule , generating a noisy bounding box : , wherein the real target bounding box , and is a normalized horizontal coordinate and a normalized vertical coordinate of the center of the target in the image coordinate system, is a width of the normalized target, is a height of the normalized target; denotes the accumulated coefficient of variance from the initial time instant to the time step , , is a random noise vector following a standard normal distribution with the same dimension as the bounding box, is a pre-defined noise schedule sequence; 5b) the noisy bounding box A region alignment operation is performed on the multi-scale enhanced feature pyramid after differential edge enhancement and dynamic channel fusion enhancement, corresponding region features are extracted, and are input together with the time step embedding to the diffusion detection head; 5c) the noisy bounding box and its corresponding time step is input to a diffusion detector head, which predicts, through a multi-layer dynamic interaction module, the target class confidence associated with the noisy box at the current time step and the added Gaussian noise ; 5d) Hungarian matching algorithm is used to establish one-to-one optimal matching relationship between the predicted box set and the real target box set output in step 5f), and each predicted box is assigned a unique real box as its supervision signal; 5e) Based on the matching relationship established in step 5g), construct and calculate the training loss function : , wherein, is a classification loss, is an L1 loss, is a generalized IoU loss, and a weighted combination of the above constitutes the bounding box regression loss, is calculated according to the predicted noise and the noisy bounding box to obtain the de-noised bounding box, is the real target bounding box, is a classification loss weight coefficient, is an L1 regression loss weight coefficient, is a generalized IoU regression loss weight coefficient, the three weight coefficients are respectively used to control the contribution proportion to the total loss; 5f) The network parameters of the diffusion detection head are iteratively updated by a gradient descent-based back propagation algorithm to minimize the loss, so that the diffusion detection head learns to gradually recover the real target box and its class from any noise distribution; 5g) The same form of loss as step 5h) is applied to multiple intermediate layers of the detection head to improve training stability and convergence speed with a deep supervision mechanism; 5h) Repeat steps 5d) to 5j) until the performance indicators of the model on the validation set reach the preset threshold or the number of training iterations reaches the preset upper limit, and the training of the diffusion model detection head is completed.

7. The method of claim 1, wherein, The SAR image to be detected in (6) is input into the trained diffusion model detection head for iterative denoising inference, and the final ship target detection result is output, including: 6a) In the SAR image to be detected, a set of random noise boxes are generated from a Gaussian prior distribution as initial boundary box proposals; 6b) The SAR image to be detected is feature-extracted by a deep convolutional neural network to obtain a multi-scale feature map, and the multi-scale feature map is differentially edge-enhanced and dynamically channel-fused to obtain an enhanced multi-scale feature pyramid; 6c) The initial boundary box proposals generated in step 6a) and the enhanced multi-scale feature pyramid obtained in step 6b) are input into the trained diffusion model detection head; 6d) The diffusion model detection head predicts the class confidence and noise components to be removed corresponding to the current boundary box proposal based on the initial boundary box proposals input in step 6c) in a preset time step sequence: 6d1) At each current time step, the bounding box proposal output by the last iteration step is taken as the current noise box, and the noise box and its corresponding time step embedding information are input into the region feature alignment module inside the detection head to extract the corresponding region features; 6d2) The detection head predicts the class confidence corresponding to the noise box and the noise component to be removed through its dynamic interaction module; 6e) Based on the predicted noise component to be removed, the position and size of the current bounding box proposal are updated to obtain an updated bounding box; 6f) The updated bounding box is taken as the input of the next iteration step, and steps 6d to 6e are repeatedly executed for multi-step iteration denoising until a preset inference step number is reached; 6g) The bounding box output by the final iteration step is taken as the prediction result, and score filtering and non-maximum suppression operations are performed based on its corresponding class probability distribution to output the final ship target detection result.

8. A multi-scale SAR image ship detection system based on edge enhancement and diffusion denoising, characterized in that, Comprise: a data preprocessing module for standardizing the input SAR image; a multi-scale feature extraction module for extracting multi-scale feature maps of the SAR image; a dynamic channel fusion enhancement module for spatially adaptively fusing low-level feature maps; a differential edge enhancement module for strengthening edge features in middle-high level feature maps and suppressing noise; a diffusion model detection head module for receiving a multi-scale feature pyramid composed of the enhanced feature maps from the dynamic channel fusion enhancement module and the differential edge enhancement module, and through an iterative denoising process, gradually optimizing and predicting the class confidence and bounding box coordinates of the target from the initial noise box distribution; an output module for performing score filtering and non-maximum suppression operations on the bounding box prediction result output by the diffusion model detection head module based on its class probability distribution to generate a detection result containing the final target class and accurate bounding box coordinates.

9. The system of claim 8, wherein, The dynamic channel fusion enhancement module comprises: a feature input submodule for receiving low-level feature maps P2 from the multi-scale feature extraction module; an inner convolution kernel generation submodule for channel compression and spatial average pooling of the low-level feature maps P2, and generating a spatial adaptive convolution kernel related to the spatial position through 1x1 convolution; a dynamic feature modulation submodule for weighting and aggregating the local neighborhood of the low-level feature maps P2 using the spatial adaptive convolution kernel, and outputting enhanced features after dynamic spatial-channel modulation; a dual-path feature fusion submodule for concatenating the original low-level feature maps P2 and the enhanced features in the channel dimension, and performing channel compression to the original channel number through a 1x1 convolution layer, and then applying batch normalization and ReLU activation functions in turn, and outputting the final dynamic channel fusion enhanced features.

10. The system of claim 8, wherein, The differential edge enhancement module comprises: a feature input submodule for receiving middle-high level feature maps P3, P4 and P5 from the multi-scale feature extraction module; A local differential response enhancement sub-module is configured to calculate, for each mid-high layer feature map P3, P4 and P5, an absolute difference value between a center pixel and all pixels in a neighborhood at each spatial position; then, based on the mean and standard deviation of the local region difference value, a dynamic enhanced response is generated to form a differential response feature map representing edge and texture changes; A residual fusion sub-module is configured to fuse the differential response feature map as a residual term with the corresponding original mid-high layer feature map by weighted fusion to adaptively balance the strength of edge enhancement and noise suppression, wherein the weighted coefficient is dynamically generated by learning parameters activated by a Sigmoid function; An enhanced feature output sub-module is configured to output the weighted fused mid-high layer feature map as a component of the multi-scale feature pyramid.

11. The system of claim 8, wherein, The diffusion model detection head module comprises: A region feature alignment sub-module is configured to perform a region alignment operation on the multi-scale feature pyramid according to the current bounding box proposal at each denoising time step to extract region-level features corresponding to each proposal box; A time step embedding sub-module is configured to encode the current denoising time step into a time-aware vector aligned with the feature dimension, and fuse it with the region-level features to provide the timing context information of the denoising stage; A dynamic interaction decoding sub-module is composed of multiple cascaded dynamic attention layers, which is configured to model the mutual dependence between different proposal boxes, to adaptively extract the most relevant semantic context for each proposal box from the fused multi-scale features, and to perform a nonlinear transformation on the fused features; A prediction output sub-module is configured to predict the class confidence of each bounding box proposal and the noise component to be removed, providing an update basis for the iterative denoising process.

Citation Information

Patent Citations

  • SAR ship target detection method and system based on effective feature representation

    CN117935050A

Cited By

  • Tea fermentation degree identification method, system and equipment and storage medium

    CN121746824A

  • SAR ship detection method and system based on hierarchical attention fusion and edge enhancement

    CN121962936A

  • SAR (Synthetic Aperture Radar) detection method and system based on frequency-space double-domain enhancement framework

    CN122067108A

  • Laser irradiation concrete block drop point prediction model and construction method and prediction method

    CN122223462A