A SAR ship detection method based on multi-branch attention

By extracting potential ship regions using the SRE module and enhancing feature saliency using the MBA module, the problem of low accuracy caused by background interference in SAR ship detection is solved, and efficient ship detection is achieved.

CN117152626BActive Publication Date: 2025-12-02NANCHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310989902.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-12-02
Estimated Expiration
2043-08-08

AI Technical Summary

Technical Problem

Existing SAR ship detection methods suffer from reduced ship saliency due to interference from sea clutter, islands, reefs, and building reflections, resulting in low detection accuracy and high computational load, making it difficult to effectively identify ships.

Method used

The SRE module is used to extract potential ship regions, and the MBA module is used to enhance the saliency of ship features. The detection accuracy is improved by using a multi-branch attention network. Features are extracted and bidirectionally fused using CSPDarknet and MBA modules.

Benefits of technology

It improves the accuracy and efficiency of SAR ship detection, effectively filters out background interference, enhances the ability to express ship features in the spatial domain, and improves detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117152626B_ABST
    Figure CN117152626B_ABST
Patent Text Reader

Abstract

This invention discloses a SAR ship detection method based on multi-branch attention, belonging to the field of SAR target detection technology. The detection method includes the following steps: denoising the original image using an SRE module; extracting all possible ship-containing regions from the background using the SRE module based on the maximum inter-class variance, filtering out irrelevant background information; and then using a proposed MBA module to enhance the expressive power of ship features in the spatial domain, thereby improving the saliency of ship features and ultimately improving the accuracy of SAR ship detection. The SRE module extracts regions in the SAR image where ships may exist. This invention also uses multi-branch attention to enhance the expressive power of ship features in the spatial domain, thereby improving the saliency of ship features and thus improving the detection effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of SAR target detection technology, and specifically to a SAR ship detection method based on multi-branch attention. Background Technology

[0002] With the rapid development of the marine industry, the importance of the marine economy in the national economy is becoming increasingly prominent. Ships play a vital role in the development of marine affairs and maritime transportation. Effective detection of ships can not only improve the efficiency of maritime transportation, but also help enhance the ability of maritime defense and early warning. Synthetic Aperture Radar (SAR), as an active microwave remote sensing device, can perform high-resolution imaging of ground objects all day and all weather, and can even obtain information on vegetation and surface coverage. This imaging method is not limited by objective conditions such as light and weather. At present, SAR has become an important means of maritime observation, providing strong data support for ship detection.

[0003] While traditional object detection methods can achieve good results in certain specific scenarios, these methods rely on manually generated features for object classification and location regression, resulting in low accuracy and high computational cost. Furthermore, these methods can produce multiple correct recognition results. With the development of deep learning technology, object detection methods based on Convolutional Neural Networks (CNNs) began to emerge. R-CNN was the first deep learning algorithm successfully applied to object detection. Subsequently, more and more deep learning-based object detection methods were proposed, such as Fast R-CNN, SPPNet, and Faster R-CNN. However, these two-stage object detection methods are usually computationally slow. Therefore, Redmon et al. proposed YOLO to address this problem. In the output layer, YOLO directly regresses the bounding box and its class location. As a representative of single-stage object detection algorithms, YOLO is computationally fast and has high detection accuracy. For this reason, it has received widespread attention from researchers, and many different versions of YOLO have emerged in subsequent research, such as YOLOv3 and YOLOX.

[0004] The existing technology has the following shortcomings:

[0005] Existing detection methods are designed for optical images. However, ships in SAR images are often affected by sea clutter, islands, reefs, coastal ports, etc. The radar pulse signals reflected by buildings and sea clutter reduce the saliency of ships in the image, making the low-saliency ship features blurred, thus interfering with SAR ship detection and causing incorrect judgments. This greatly affects the performance of ship detection. Summary of the Invention

[0006] The purpose of this invention is to provide a SAR ship detection method based on multi-branch attention. The designed SRE module extracts all possible ship regions from the background based on the maximum inter-class variance, filters out irrelevant background information, and then uses the proposed MBA module to enhance the expressive power of ship features in the spatial domain, thereby improving the saliency of ship features and ultimately improving the accuracy of SAR ship detection, thus solving the shortcomings of the background technology.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a SAR ship detection method based on multi-branch attention, the detection method comprising the following steps:

[0008] S1: Denoising the original image through the SRE module;

[0009] S2: Based on Otsu, extract potential areas where ships exist from the background;

[0010] S3: Based on GLO, background information is filtered by combining global and local information. The image with background information filtered out is the input of the detection network combined with the MBA module.

[0011] S4: Extract more features through CSPDarknet and MBA modules, and fuse features in a bidirectional form from top to bottom and bottom to top;

[0012] S5: The detection results are obtained by using the fusion features of three different scales as input to the prediction head.

[0013] Preferably, the SRE module performs denoising processing on the original image including the following steps:

[0014] The weighted average of pixels with similar neighborhood structures in the image is used to obtain the estimated value of the current pixel. The calculation expression is as follows:

[0015]

[0016] Where s(x,y) represents the similarity between x and y, C represents the coordinate domain of the image, N={N(x)|x∈C} is a noisy SAR ship image, T is the denoised image, and T(y) is the value of pixel y in T.

[0017] Preferably, in step S3, filtering background information includes the following steps:

[0018] The target is separated from the background using Otsu binarization, and the calculation expression is as follows:

[0019]

[0020] Where L is the different gray levels in the image T, h*w is the resolution of the image, and P

[0028] , o , , , , b ,

[0025] , , g ,

[0024] ,

[0032] , o ,

[0027] ,

[0030] , b , , , b , , , , g ,

[0026] , , o ,

[0029] , g , ,

[0031] , 2 , , , 2 , 2 , ,

[0033] is the probability that the pixel gray level is i, and n i represents the number of pixels with the gray level of i;

[0021] Set the threshold t, 0 < t < L - 1. According to the threshold, the image pixels are divided into object C o and background C b into two categories. If the gray value of the pixel is less than or equal to the threshold, it is classified as C<00​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​Preferably, the CSPDarknet extracts features from the detection network by replacing DarkNet residual blocks with cross-level particles based on DarkNet.

[0034] The MBA module is embedded into CSPDarknet, and different weights are used in different branches.

[0035] Preferably, the MBA module includes an extraction unit and a transformation unit. The extraction unit is used to extract features from the feature map. For a given input X, its features are extracted through extraction blocks, RF = E(X, w e ), w e Here are the parameters for the extraction module, RF is the output, and features RF1, RF2, and RF3 with three different receptive fields are obtained through three convolutional branches in parallel. The convolutional kernels for the three branches are 1×1, 3×3, and 5×5, respectively, and the activation function is ReLU. The calculation expression is as follows:

[0036] Relu(x) = max(0,x)

[0037] Then, the outputs of the three branches are merged using the Add operation, and the calculated expression is: RF = RF1 + RF2 + RF3.

[0038] Preferably, the transformation unit is used to process the extracted features and transform the features into a nonlinear attention space, expressed as W = T(RF, w t ), where w t The parameters for the transformation operation are W, which is the output of the module, W = [W1, W2, W3]. The width and height of each element in W are the same as RF. The fusion module fuses the attention map output with the original convolutional block, and the output expression is:

[0039]

[0040] Where i is the index of W, and X' is the fused feature map.

[0041] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0042] 1. This invention uses the SRE module to extract all possible ship-containing regions from the background based on the maximum inter-class variance, filters out irrelevant background information, and then uses the proposed MBA module to enhance the expressive power of ship features in the spatial domain, thereby improving the saliency of ship features and ultimately improving the accuracy of SAR ship detection. The SRE module extracts regions in SAR images that may contain ships and also enhances the expressive power of ship features in the spatial domain through multi-branch attention, thereby improving the saliency of ship features and thus improving the detection effect. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0044] Figure 1 This is a schematic diagram of the overall architecture of the present invention.

[0045] Figure 2 This is the SRE flowchart of the present invention.

[0046] Figure 3 This is a schematic diagram of the MBA module of the present invention.

[0047] Figure 4 This is a schematic diagram of the image before SRE processing according to the present invention.

[0048] Figure 5 This is a schematic diagram of the image after SRE processing according to the present invention.

[0049] Figure 6 This is a schematic diagram of the PR curve for the offshore scene of this invention.

[0050] Figure 7 This is a schematic diagram of the PR curve in the nearshore scenario of the present invention. Detailed Implementation

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

[0052] Example 1: Please refer to Figure 1 As shown in this embodiment, a SAR ship detection method based on multi-branch attention is described. The detection method includes the following steps:

[0053] First, the original image is denoised in the SRE module to avoid the negative impact of speckle noise on the binarization process. Since the background information of the far-shore scene is relatively simple, Otsu can extract the potential areas where ships may exist well from the background. However, in the near-shore scene, the complex background information makes it difficult to distinguish between land and sea, and Otsu is difficult to extract the potential areas accurately. Therefore, we propose an improved Otsu algorithm called GLO, which combines global and local information to filter complex background information. The image with the background information filtered out is the input of the detection network combined with the MBA module. CSPDarknet and the MBA module can extract more useful features and enhance the saliency of ship features. Inspired by PANet, the features are fused in a bidirectional form from top to bottom and bottom to top. Finally, the detection results are obtained by using the prediction head and inputting the fused features at three different scales.

[0054] This application uses the SRE module to extract all possible ship-containing regions from the background based on the maximum inter-class variance, filters out irrelevant background information, and then utilizes the proposed MBA module to enhance the expressive power of ship features in the spatial domain, thereby improving the saliency of ship features and ultimately achieving the goal of improving SAR ship detection accuracy. The SRE module extracts regions in SAR images that may contain ships and also enhances the expressive power of ship features in the spatial domain through multi-branch attention, thereby improving the saliency of ship features and thus improving detection performance.

[0055] Example 2: Please refer to Figure 2 As shown, in order to alleviate the interference caused by speckle noise and bright areas in nearshore scenes, this application proposes an SRE module to extract potential areas where ships may exist. The SRE module is divided into three parts: denoising, Otsu, and GLO. The SRE module simulates the visual pathway processing mechanism of the brain to transform complex backgrounds into a single background.

[0056] In SAR images, ships appear as typical bright objects. In other words, ships may exist in the bright areas of SAR images. Therefore, the essence of SAR ship detection is to detect bright targets in a dark background.

[0057] A common operation is to separate potential target regions from the background by binarizing the image. Due to speckle noise, there are a large number of clutter points in the binarized image. To minimize the impact of speckle noise on the binarization result, we use Non-linear Modeling (NLM) to denoise the SAR image. The basic idea is to obtain the estimated value of the current pixel by calculating the weighted average of pixels with similar neighborhood structures in the image. Assuming the noisy SAR ship image is N = {N(x) | x ∈ C}, where C represents the coordinate domain of the image, and the denoised image is T, the value of pixel y in T is calculated using the following expression:

[0058]

[0059] Where s(x, y) represents the similarity between x and y.

[0060] In the far - shore scene, the gray - level features of ships have a large difference from the background. Through Otsu binarization, the target can be easily separated from the background. Assume that there are L different gray - level levels in image T, the resolution of the image is h*w, and the probability of pixel gray - level being i can be represented by P i and the calculation expression is:

[0061]

[0062] where n i represents the number of pixel points with gray - level i. Assume there is a threshold t, 0 < t < L - 1. According to the threshold, the image pixels are divided into object C o and background C b two categories. If the gray - level value of a pixel is less than or equal to the threshold, it is classified as C b , if it is greater than t, it is classified as C o . The probability that a pixel is classified as C b and C o can be represented by P b and P o respectively, and their equations are described as follows:

[0063]

[0064]

[0065] According to the above description, calculate the average gray - level value (MGV) of pixels in C b and C o through the following formula:

[0066]

[0067]

[0068] Then the calculation expression of the MGV of the whole image is:

[0069]

[0070] Therefore, the expression for calculating the between - class variance between the background and the object is:

[0071] δ 2 =P b (M b -M g ) 2 +P o (Mo -M g ) 2

[0072] The threshold t that maximizes the inter-class variance is called the optimal global threshold, denoted as t. g Based on the optimal threshold, Otsu is able to separate the target area from the background area very well. Therefore, it is used as part of the SRE module for potential areas where ships may exist in SAR images and to filter out invalid background areas.

[0073] In offshore scenes, due to less interference, Otsu's threshold calculated based on the global region can show good separation results. However, in nearshore scenes, there is complex background interference, which leads to a large difference in the number of pixels between the target region and the background region. The histogram will show that one peak is much larger than another. In this case, due to the limitations of Otsu's principle, the calculated threshold will inevitably shift towards the direction of the larger peak. The generated target region contains too much background information, which has a negative impact on the detection results.

[0074] To address this issue, we propose an improved Otsu algorithm, called GLO, which combines global and local information to extract salient regions. In the improved algorithm, after the global Otsu, a local Otsu is performed on the extracted target region to further remove background information, thereby reducing the impact of irrelevant background information on the final detection performance. The GLO algorithm's computational logic is shown in Table 1.

[0075]

[0076] Table 1

[0077] GLO can effectively extract the area where ships are most present, allowing deep learning networks to extract more features with higher representational power and improve their detection accuracy.

[0078] Example 3: As Figure 3 As shown, CSPDarknet is used as the backbone network to extract features in the detection network. Based on DarkNet, its residual blocks are changed to cross-level particles (CSP), i.e., CSPDarknet. This structure enhances the learning ability of CNN, eliminates the computational bottleneck, reduces memory usage, and improves the inference speed of the network.

[0079] In this section, to enhance the characteristics of ships, we propose a multi-branch attention (MBA module) module and embed it into CSPDarknet. By using different weights in different branches, the MBA module can not only enhance the features of ships, but also improve the discriminability of features, thereby improving the detection accuracy.

[0080] In PANet, a bidirectional fusion method is used to shorten the information path between the low-level features and the high-level features. Inspired by this, this application also adopts a bidirectional fusion method to fuse the output features of CSPDarknet. This can better ensure the integrity and diversity of functions. In terms of training strategy, SimOTA is used to achieve anchorless operation. Its main function is to assign a ground truth (GT) box to each positive sample (i.e. the predicted box output by the network) and fit the positive sample to the GT box.

[0081] The MBA module enhances the saliency of objects in different receptive domains in space, obtaining more discernible ship features. It includes an extraction unit and a transformation unit. The extraction unit extracts features from the feature map. For a given input X, its features are extracted through extraction blocks, RF = E(X, w e ), w e Here are the parameters for the extraction module, and RF is the output. First, features RF1, RF2, and RF3 with three different receptive fields are obtained in parallel through three convolutional branches. The convolutional kernels for the three branches are 1×1, 3×3, and 5×5, respectively, and the activation function is ReLU. The calculation expression is as follows:

[0082] Relu(x) = max(0,x)

[0083] Then, the outputs of the three branches are merged using the Add operation, and the calculated expression is:

[0084] RF = RF1 + RF2 + RF3

[0085] The transformation unit processes the extracted features and transforms them into a nonlinear attention space, which can be represented as W = T(RF, w t ), where w t The parameters for the transformation operation are W, which is the output of the module, W = [W1, W2, W3]. The width and height of each element in W are the same as RF. The fusion module fuses the attention map output with the original convolutional block (the original convolutional block), and the output expression is:

[0086]

[0087] Where i is the index of W, and X' is the fused feature map.

[0088] Example 4: This example mainly conducts experiments on the methods described in Examples 1-3, as detailed below:

[0089] The performance of the proposed method is evaluated using SSDD as the dataset. SSDD is the first publicly available SAR ship detection dataset, and its details are shown in Table 1. It features multiple polarization modes, multiple imaging modes, and multiple resolutions. Therefore, the experiments carried out on this dataset can better demonstrate the robustness of the proposed method. The dataset contains 1160 images with heights between 190 pixels and 526 pixels and widths between 214 pixels and 668 pixels. 926 images are divided into the training set and 232 images are divided into the test set.

[0090] All experiments in this application are implemented based on the Keras framework, using Python as the programming language and PyCharm as the integrated development environment. The software packages used include tensorflow-gpu, numpy, and keras. Model training was performed on a 64-bit Windows operating system computer, which could be accelerated using GPU. The computer hardware included an Intel® Xeon® Silver 4210 CPU @ 2.20GHz, an NVIDIA Quadro RTX 5000, and 32GB of RAM. The experimental training parameters are shown in Table 2.

[0091] Table 2 Parameter Setting Table

[0092]

[0093] This application uses commonly used evaluation metrics in the field of object detection, such as precision, recall, F1 score, and AP0.5, to analyze the performance of object detection. When determining the accuracy of the predicted bounding box, the Intersection over Union (IoU) is also used to measure the fit between the predicted bounding box and the ground truth bounding box. IoU is the ratio of the intersection to the union of the predicted bounding box and the ground truth. The IoU threshold for distinguishing between positive and negative samples is typically 0.5, and its calculation expression is as follows:

[0094]

[0095] Among them B p B represents the prediction box. gt This represents the ground truth frame; the higher the IoU value, the better the prediction result.

[0096] When inspecting ships, true positives (TP), false positives (FP), and false negatives (FN) can occur. TP represents the number of correctly classified positive samples, FP represents the number of false positives, and FN represents the number of missed positive samples. Precision (P) represents the ratio of correctly detected ships to the total number of ships detected, and recall (R) is the ratio of correctly detected ships to the total number of ships detected. The expressions for calculating P and R are as follows:

[0097]

[0098]

[0099] Using only P or R to evaluate a model is inaccurate. Therefore, the F1 score, which combines P and R, is introduced as one of the evaluation metrics for the model. The calculation equation is as follows:

[0100]

[0101] Mean precision (AP) can also more comprehensively evaluate the effectiveness of a method. With recall on the x-axis and precision on the y-axis, AP is the area enclosed by the recall curve (PR curve), expressed by the formula... Calculate AP 0.5 This is the AP value when IoU is 0.5.

[0102] like Figures 4-5 As shown, due to the large amount of background and noise interference in SAR images, in order to effectively reduce the negative impact of these interferences on ship detection, we propose an SRE module to extract potential areas in the image where ships may exist. To better demonstrate the effect of the PRE module proposed in this application.

[0103] Figure 4 (a) and (b) are the original distant shore images. Figure 5 Figures (e) and (f) show the results after processing by the SRE module. As can be seen from these figures, a significant amount of speckle noise has been removed, making the target more salient and facilitating feature extraction. Figure 4 Images (c) and (d) are the original nearshore images. Figure 5 In the middle (g) and (h) images, the processed nearshore scene images show that the module can retain potential areas where ships may exist and remove invalid background information.

[0104] In offshore scenarios, ship detection is relatively easier due to less interference. However, in nearshore scenarios, the background is complex, and ships are easily covered by the background, making it difficult to extract significant features and greatly increasing the difficulty of accurate detection. To demonstrate the effectiveness and competitiveness of our method, we conducted comparative experiments in both offshore and nearshore scenarios and compared our method with current mainstream methods. In these experiments, we still used P, R, F1 scores and AP0.5 as evaluation metrics.

[0105] Table 3 Detection results of different methods for remote scenes

[0106]

[0107]

[0108] Table 3 shows the detection results of different methods in remote scenes. RetinaNet, Faster R-CNN, YOLOX, and SSD-SM all have AP0.5 greater than 0.9, while RetinaNet, M2Det, YOLOX, and SSD-SM all have F1 scores greater than 0.9. As can be seen from the table, all these methods perform well in remote scenes. Furthermore, EfficientDet has the highest P-value, while our method has the highest R, F1, and AP0.5 values. In other words, the method proposed in this application has the best detection performance. Figure 6 The PR curves of different methods in the far-shore scenario are presented, with the red curve representing our method, which has the largest area, demonstrating the superiority of our method.

[0109] Table 4. Detection results of different methods in nearshore scenarios.

[0110]

[0111] Table 4 presents the detection results of different methods in nearshore scenarios. In the marine scenario, EfficientDet has the highest P-value. For the other three metrics, our method shows the best performance. YOLOX and our method both have F1 scores and AP0.5 exceeding 0.8, while our method outperforms YOLOX in all four metrics. A comparison between Table 3 and Table 2 reveals that the detection accuracy of these methods is significantly reduced in nearshore scenarios, indicating that detection in nearshore scenarios is much more difficult than in offshore scenarios. Despite this, our method still achieves relatively good results, demonstrating its effectiveness. Figure 7 The graph shows the performance (PR) curves of different methods in nearshore scenarios, with the red curve representing our method. It is clear from the graph that the area enclosed by the red curve is much larger than that of other methods, further illustrating that our method performs much better than the others.

[0112] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0113] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0114] It should be understood that the term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this application generally indicates an "or" relationship between the preceding and following related objects, but it may also indicate an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0115] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0116] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0117] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0118] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0119] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0121] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0123] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A SAR ship detection method based on multi-branch attention, characterized in that: The detection method includes the following steps: S1: Denoising the original image through the SRE module; S2: Based on Otsu, extract potential areas where ships exist from the background; S3: Based on GLO, background information is filtered by combining global and local information. The image with background information filtered out is the input of the detection network combined with the MBA module. S4: Extract more features through CSPDarknet and MBA modules, and fuse features in a bidirectional form from top to bottom and bottom to top; S5: Detection results are obtained by inputting three different scales of fused features into the prediction head; Specifically, CSPDarknet extracts features from the detection network, and on the basis of DarkNet, replaces DarkNet residual blocks with cross-level particles; embeds the MBA module into CSPDarknet, and uses different weights in different branches; The MBA module includes an extraction unit and a transformation unit. The extraction unit is used to extract features from the feature map. For a given input X, its features are extracted through extraction blocks, RF=E(X, w e ), w e Here, RF represents the parameters of the extraction module, and RF is the output. It obtains features RF1, RF2, and RF3 with three different receptive fields through three parallel convolutional branches. The convolutional kernels for the three branches are 1×1, 3×3, and 5×5, respectively, and the activation function is ReLU. The calculation expression is as follows: Then, the outputs of the three branches are merged using the Add operation, and the calculated expression is: ; The transformation unit processes the extracted features and transforms them into a nonlinear attention space, denoted as W = T(RF, w t ), where w t The parameters for the transformation operation are W, which is the output of the module, W = [W1, W2, W3]. The width and height of each element in W are the same as RF. The fusion module fuses the attention map output with the original convolutional block, and the output expression is: Where i is the index of W, and X' is the fused feature map.

2. The SAR ship detection method based on multi-branch attention according to claim 1, characterized in that: The SRE module performs noise reduction processing on the original image, including the following steps: The weighted average of pixels with similar neighborhood structures in the image is used to obtain the estimated value of the current pixel. The calculation expression is as follows: ; Where s(x, y) represents the similarity between x and y, C represents the coordinate domain of the image, N = {N(x) | x∈C} is the noisy SAR ship image, and T is the denoised image. Let y be the value of pixel T.

3. The SAR ship detection method based on multi-branch attention according to claim 2, characterized in that: In step S3, filtering background information includes the following steps: The target is separated from the background using Otsu binarization, and the calculation expression is as follows: ; In the formula, L represents different gray levels in image T, h*w represents the image resolution, and P... i Let n be the probability that pixel grayscale is i. i This represents the number of pixels with gray level i. Set a threshold t, 0 < t < L-1, and divide the image pixels into objects C according to the threshold. o and background C b There are two categories. If the grayscale value of a pixel is less than or equal to the threshold, it is classified as C. b If it is greater than t, then it is classified as C. o .

4. The SAR ship detection method based on multi-branch attention according to claim 3, characterized in that: The image pixels are classified as C. b and C o The probabilities are respectively represented by P b and P o express: ; ; C b and C o The expression for calculating the average grayscale value of a pixel is: ; ; The MGV calculation expression for the entire image is: ; The expression for calculating the inter-class variance between the background and the objects is: ; The threshold t that maximizes the inter-class variance is called the optimal global threshold, denoted as t. g Based on the optimal global threshold, Otsu separates the target region from the background region.