Ship classification identification method and device for port SAR image
By improving the YOLOv8m-OBB network, adopting specific structures of BiFPN and EMA, and combining a dynamic hybrid loss function, the accuracy and robustness issues of ship target recognition in port SAR images were solved, achieving high-precision ship classification and recognition results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-07
AI Technical Summary
Existing port SAR images show densely packed ship targets with large differences in scale and severe mutual occlusion, resulting in a high rate of missed detection for small targets, numerous false alarms near the shore, and easy confusion of ship types, making it difficult to meet the high-precision requirements of intelligent port monitoring.
The YOLOv8m-OBB network is improved by adopting the Bidirectional Feature Pyramid Network (BiFPN) and the Multi-Scale Attention Module (EMA). Through bidirectional cross-scale fusion and multi-scale attention enhancement, a fused feature map with shallow details and deep semantic features is generated. The detection network is trained using a dynamic hybrid loss function to suppress background interference and improve the response of key scattering regions of the ship.
It improves the comprehensive classification and identification accuracy of ship targets in complex port scenarios, significantly enhances the identification accuracy and robustness of the detection network, adapts to different SAR imaging bands, and achieves high-precision ship classification and identification.
Smart Images

Figure CN121811275A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of signal processing, in particular to a ship classification and identification method and device for port SAR images. BACKGROUND
[0002] As the core hub of global trade, the accuracy and efficiency of ship monitoring in the port are directly related to the safety and management efficiency of port operation. Synthetic Aperture Radar (SAR) technology has become a key technical means for port ship monitoring due to its all-weather, all-day imaging capability and high resolution characteristics. The resolution of spaceborne SAR images has reached 1.0 meters, 0.5 meters and other high resolution levels, providing a data basis for fine detection and identification of various ship targets in the port.
[0003] However, the ship targets in the port SAR image are dense, have large scale differences, are severely occluded, and are strongly disturbed by near-shore building clutter, which leads to the problems of high small target miss detection rate, many near-shore false alarms, and easy confusion of ship classes in the existing general target detection model, making it difficult to meet the high precision requirements of intelligent monitoring of the port. SUMMARY
[0004] The present application provides a ship classification and identification method and device for port SAR images. The technical solution is as follows: On the one hand, a ship classification and identification method for port SAR images is provided, the method comprising: replacing the feature pyramid network in the YOLOv8m-OBB network with a bidirectional feature pyramid network BiFPN, and embedding a multi-scale attention module EMA between each detection output end in the YOLOv8m-OBB network and the output end of the BiFPN to obtain a detection network; the BiFPN is used to perform bidirectional cross-scale fusion on the multi-scale features extracted by the backbone network to generate a fusion feature map fused with shallow detail features and deep semantic features; the EMA is used to perform multi-scale attention enhancement on the fusion feature map to focus and enhance the response of the key scattering area of the ship; training the detection network using a dynamic hybrid loss function to obtain a trained detection network; using the trained detection network to perform classification and identification on the to-be-detected port SAR image to obtain a classification and identification result; the classification and identification result includes a rotated bounding box, a ship class, and a confidence.
[0005] On the other hand, a ship classification and identification device for port SAR images is provided, the device comprising: A construction unit is used to replace the feature pyramid network in the YOLOv8m-OBB network with a bidirectional feature pyramid network (BiFPN), and to embed a multi-scale attention module (EMA) between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain a detection network. The BiFPN is used to perform bidirectional cross-scale fusion of the multi-scale features extracted by the backbone network to generate a fused feature map that integrates shallow detail features and deep semantic features. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of key scattering regions of the ship. The training unit is used to train the detection network using a dynamic hybrid loss function to obtain a trained detection network. The identification unit is used to classify and identify the SAR image of the port to be detected using a trained detection network, and obtain the classification and identification results; the classification and identification results include the rotated bounding box, ship category and confidence level.
[0006] On the other hand, a computer device is provided, the computer device including a memory and a processor, the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to implement the steps of the above-described method for ship classification and identification of port SAR images.
[0007] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of the above-described method for ship classification and identification of port SAR images.
[0008] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method for ship classification and identification of port SAR images.
[0009] The technical solution provided by this invention can bring at least the following beneficial effects: By improving the YOLOv8m-OBB network, the resulting detection network adopts a specific structure of BiFPN followed by EMA. When classifying and identifying ships in port SAR images, BiFPN first fuses shallow details beneficial to small ship targets and ship edges with deep semantic features beneficial to understanding the outlines of large ships through bidirectional cross-scale fusion. This effectively alleviates the problem of incomplete feature representation due to varying target scales and mutual occlusion. Then, EMA is used to perform multi-scale attention enhancement on the fused features, which are rich in contextual information. This focuses and enhances key scattering areas of the ship while suppressing background interference such as sea clutter and nearshore buildings. This scheme, through the synergistic effect of global fusion and local focusing, improves the overall classification and identification accuracy of the detection network for various ship targets in complex port scenes. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart of a ship classification and identification method for port SAR images provided by an embodiment of the present invention; Figure 2 This is a detection network architecture diagram provided in one embodiment of the present invention; Figure 3 This is a ground truth diagram of a port SAR image provided in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the detection results and feature visualization of the YOLOv8m-OBB baseline model provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the detection results and features of a detection network provided in an embodiment of the present invention; Figure 6 This is a structural diagram of a ship classification and identification device for port SAR images provided in an embodiment of the present invention; Figure 7 This is a hardware architecture diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0012] 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 some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0013] Please refer to Figure 1 This invention provides a method for ship classification and identification in port SAR images, the method comprising: Step 100: Replace the feature pyramid network in the YOLOv8m-OBB network with a bidirectional feature pyramid network (BiFPN), and embed a multi-scale attention module (EMA) between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain a detection network. The BiFPN is used to perform bidirectional cross-scale fusion of the multi-scale features extracted by the backbone network to generate a fused feature map that integrates shallow detail features and deep semantic features. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of key scattering regions of the ship. Step 102: Train the detection network using a dynamic hybrid loss function to obtain a trained detection network; Step 104: Use the trained detection network to classify and identify the SAR image of the port to be detected, and obtain the classification and identification results; the classification and identification results include the rotated bounding box, ship category and confidence level.
[0014] In this embodiment of the invention, the YOLOv8m-OBB network is improved, resulting in a detection network with a specific structure of BiFPN followed by EMA. When classifying and identifying ships in port SAR images, BiFPN first fuses shallow detail features beneficial to small ship targets and ship edges with deep semantic features beneficial to understanding large ship targets and ship outlines through bidirectional cross-scale fusion. This effectively alleviates the problem of incomplete feature representation due to varying target scales and mutual occlusion. Then, EMA is used to perform multi-scale attention enhancement on the fused features rich in contextual information, thereby focusing and enhancing key scattering areas of the ship while suppressing background interference such as sea clutter and nearshore buildings. This scheme, through the synergistic effect of global fusion and local focusing, can improve the comprehensive classification and identification accuracy of the detection network for various ship targets in complex port scenes.
[0015] The following description Figure 1 The execution method for each step is shown.
[0016] First, for step 100, the feature pyramid network in the YOLOv8m-OBB network is replaced with a bidirectional feature pyramid network (BiFPN), and a multi-scale attention module (EMA) is embedded between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain the detection network.
[0017] Please see Figure 2 This is a detection network architecture diagram provided in an embodiment of the present invention. Figure 2 In this network, the detection network is based on the YOLOv8m-OBB network. All feature pyramid networks in the YOLOv8m-OBB network are replaced with BiFPN, and an EMA module is embedded before each detection output (Detect), located between the BiFPN and Detect. The detection network consists of 5 layers (P1-P5), representing 5 scales. From left to right, they are the input layer, backbone network, neck network, and head network. Figure 2 In this code, Conv is the standard convolutional layer, C2f is the convolutional fusion layer, Upsample is the upsampling layer, and SPPF is the pooling fusion layer.
[0018] In this embodiment of the invention, BiFPN is used to replace the PANet structure in the original neck network. BiFPN is used to perform bidirectional cross-scale fusion of multi-scale features extracted by the backbone network through bidirectional cross-layer connections to generate a fused feature map that integrates shallow detail features and deep semantic features. By effectively integrating shallow high-resolution detail information with deep abstract semantic features, better multi-scale feature expression is achieved.
[0019] Specifically, high-level features (e.g., P5) are upsampled and concatenated with low-level features (e.g., P3), while low-level features are downsampled and interact with high-level features, forming a bidirectional information flow. For each fusion node, learnable weights are used to weightedly fuse shallow detail features and deep semantic features. The BiFPN output feature map is calculated as follows: Where O represents the fused feature map. The input feature map is after upsampling or downsampling. Learnable weights corresponding to each input feature It is a very small constant.
[0020] In this embodiment of the invention, an EMA is embedded between each detection output in the YOLOv8m-OBB network and the output of the BiFPN. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of the ship's key scattering regions.
[0021] The reason for designing the specific structure of BiFPN followed by EMA in this embodiment of the invention is that if EMA is applied to the original features extracted by the backbone network, these features, although containing details and semantics, have a more singular perspective. For example, shallow features are rich in details but filled with a lot of irrelevant texture noise (wave textures, building clutter); deep features are semantically abstract but lose the details needed for precise localization. Allocating attention to such "noisy" or "fuzzy" information can easily lead to misjudgment. However, after embedding EMA at the output of BiFPN, BiFPN has already completed the information fusion work, that is, it performs cross-scale weighted fusion of shallow detailed features (e.g., edge features) and deep semantic features (e.g., this area belongs to a ship-type object). At this time, EMA receives a high-value intelligence map in which multi-scale and multi-dimensional contextual information is fused at each location.
[0022] Because the fusion feature map incorporates multi-scale and multi-dimensional contextual information, the signal of the key scattering region of the ship target is stronger. The key scattering regions of the ship, such as corner reflectors and masts, are not only bright (shallow details) in the fusion feature map, but are also surrounded and confirmed by strong semantic information that "this is part of the ship". This synergy between detail and semantics makes the signal-to-noise ratio of the key scattering region in the fusion feature map extremely high.
[0023] Furthermore, this fused feature map can also suppress background interference. For an isolated, scattering-point-like bright spot of ocean waves, it may stand out in shallow features, but in fused features, due to the lack of support from high-level semantics, its weight is reduced during BiFPN fusion. Therefore, in the fused features received by EMA, the feature response of this type of background interference is relatively weak.
[0024] Furthermore, placing the EMA after the BiFPN processing flow, rather than before, is because if it were placed before BiFPN, the EMA would perform attention enhancement under conditions of high noise in single-layer features, which could easily lead to feature enhancement in erroneous regions. However, placing it after BiFPN ensures that the EMA performs attention enhancement with clear semantics and details, resulting in a more precise focusing process and improved accuracy in ship classification and recognition.
[0025] In this embodiment of the invention, the multi-scale attention enhancement of the fused feature map may specifically include: dividing the fused feature map into multiple groups along the channel dimension, performing convolution operations at different scales on each group to simultaneously extract local details and contextual information; using learnable channel attention weights to perform weighted fusion of the outputs of each group to obtain multi-scale aggregated features; and using a spatial attention mechanism to perform spatial recalibration on the multi-scale aggregated features.
[0026] By performing convolution operations at different scales in groups, characteristics of the ship's scattering region at different scales can be captured simultaneously: large-scale convolution kernels perceive the overall outline and longer edges of the ship, while small-scale convolution kernels precisely capture small, strong scattering points. Since information at different scales has already been aligned in the fused feature map, the branches of the EMA can extract this information more efficiently.
[0027] By using learnable channel attention weights to weight and fuse the outputs of each group, the system can learn which channel combinations are more important to the final recognition result. The fused feature map includes various channels from edges and textures to high-level semantics, and EMA can learn to assign higher weights to channels that represent the strong reflection of ship metal and regular geometric shapes.
[0028] This spatial attention mechanism can extract spatial responses using global average pooling and max pooling, and generate a spatial attention map through convolution. The product of the spatial attention map and the multi-scale aggregated features is determined as the output feature map after spatial recalibration. That is, recalibration is achieved according to the following formula: ;in, The output feature map after recalibration. This is a multi-scale aggregation feature. Through a spatial attention mechanism, it can more accurately highlight the key scattering areas that truly belong to the ship on the spatial map, thereby accurately enhancing the response of the ship's key scattering areas and improving the ship's ability to distinguish targets from complex backgrounds.
[0029] In this embodiment of the invention, BiFPN first dynamically fuses shallow and deep features based on the learned weights, and then EMA performs attention enhancement on the fused features that already contain rich multi-scale information. With the synergistic effect of the two, the weight mechanism of BiFPN can ensure that the features input to EMA are already the optimal combination, and EMA performs the final optimization on this basis.
[0030] Then, for step 102, the detection network is trained using a dynamic hybrid loss function to obtain a trained detection network.
[0031] To address the issues of uneven category distribution and insufficient bounding box regression accuracy in ship identification using port SAR images, this invention proposes a dynamic hybrid loss function. Specifically, the dynamic hybrid loss function includes classification loss and regression loss; the regression loss dynamically changes during training based on the degree of overlap between the anchor box and the target box, so that when the overlap exceeds a set value, the regression loss reduces its focus on the anchor box center point.
[0032] In one implementation, the dynamic hybrid loss function is as follows: in, The classification loss is the total loss. The regression loss is used to measure the difference between the predicted class and the true class. Used to measure the positional deviation between the anchor box and the target box; the weighting coefficients of the classification loss. Weighting coefficients of regression loss The model is dynamically adjusted during the training process to enhance classification constraints in the early stages of training and bounding box regression constraints in the later stages of training, thereby achieving collaborative optimization of classification and localization tasks.
[0033] For classification loss, it can be: in, To detect the network's predicted probability of the true class; through class weights. Increase attention to minority samples and utilize moderating factors. Suppressing the gradient influence of easily separable samples, thus preventing class imbalance in the process.
[0034] The regression loss can be: in, The dynamic focusing coefficient is determined by the degree of group popularity. control, and For hyperparameters; This is the initial regression loss; The initial regression loss used to amplify the anchor box is such that the greater the overlap between the anchor box and the target box, the less attention is paid to the distance between the center points. The IoU loss is separated from the computation graph and does not participate in gradient backpropagation; and Here are the x and y coordinates of the center point of the target bounding box; and The width and height are the minimum bounding boxes corresponding to the anchor box and the target box, respectively. The superscript * indicates that the corresponding parameters do not participate in gradient updates.
[0035] It should be noted that the weighting coefficients and Try dynamic scheduling during training, focusing on classification learning in the early stages and shifting to regression optimization in the later stages, thereby achieving synergy and balance between classification and localization tasks.
[0036] It should also be noted that the training data used in the training process is pre-acquired. The training data can be port SAR images labeled with real labels, or it can be real port SAR images that have been sliced and labeled with real labels as training data.
[0037] Finally, for step 104, the trained detection network is used to classify and identify the SAR image of the port to be detected, and the classification and identification results are obtained.
[0038] In this embodiment of the invention, the classification and recognition result may include a rotated bounding box, ship category, and confidence level.
[0039] Specifically, this step may include: The SAR image of the port to be detected is sliced to obtain multiple slices to be detected. Each slice to be detected is input into the detection network to obtain the classification and recognition results of each slice to be detected; The classification and recognition results of each slice to be detected are mapped to the original coordinate system of the SAR image of the port to be detected, and redundant boxes are eliminated to obtain the final ship classification and recognition results.
[0040] The following example illustrates this process.
[0041] For large-sized (e.g., 10000x10000 pixels or larger) 16-bit TIFF format port SAR images, a sliding window is used to cut them into 1024x1024 pixel slices, with a 100-pixel overlap area between adjacent slices to avoid incomplete identification of ship targets due to being cut to the boundary.
[0042] The pixel values in each 16-bit depth slice are linearly normalized to the range [0, 255] and converted to 8-bit depth to meet the input requirements of the detection network, allowing for selective local contrast enhancement.
[0043] All preprocessed slices are sequentially input into the trained detection network to obtain the classification and recognition results for each slice. The classification and recognition results include the anchor frame (center point coordinates, length, width, and rotation angle), ship type (such as container ship, oil tanker, bulk carrier, etc.) and confidence level.
[0044] The coordinates of all bounding boxes on the slices are mapped to the global coordinate system of the original port SAR image according to their positions in the slices. Then, based on the non-maximum suppression algorithm of the rotated boxes, all overlapping boxes are processed by category, and the bounding box with the highest confidence in each target region is retained to eliminate redundant boxes.
[0045] The final recognition results (rotated bounding box parameters and category) are saved as a structured text file. Simultaneously, the classification results can be overlaid on the original SAR image (converted to RGB pseudo-color image) for visualization, generating an intuitive recognition effect diagram.
[0046] To verify the effectiveness of this invention, a comprehensive experimental evaluation was conducted on the FAIR-CSAR-V1.0 port scene dataset. 2909 GF-3 satellite-borne SAR images, each 1024×1024 pixels in size, were selected from this dataset, covering four target categories: bulk carriers, container ships, oil tankers, and other vessels. These images were randomly divided into a training set (1938 images), a validation set (561 images), and a test set (410 images) in a 4:1:1 ratio to ensure a balanced distribution of samples across categories.
[0047] The experimental hardware configuration consisted of an NVIDIA RTX 4090 GPU (24GB VRAM), an AMD EPYC 9354 CPU, and 64GB of RAM. The software environment was PyTorch 2.2.2 and Python 3.11.8. Automatic Mixed Precision (AMP) was used during training to improve computational efficiency and reduce VRAM usage. The AdamW optimizer was used with an initial learning rate of 3e-4, weight decay of 5e-4, a batch size of 16, and a total training duration of 150 epochs. Data augmentation strategies included random flipping (probability 0.5), Mosaic stitching (probability 0.6), and gamma correction (γ=0.5) to enhance the model's generalization ability.
[0048] On the test set, the detection network provided by this embodiment of the invention achieved significantly better performance than the baseline model. As shown in Table 1, compared with the original YOLOv8m-OBB baseline, this embodiment of the invention achieved an average precision (mAP@0.5) of 84.18%, a 6 percentage point improvement. Simultaneously, the recall rate increased from 70.80% to 80.73%, and the F1 score increased from 0.75 to 0.81.
[0049] Table 1 Please see Figure 3 This is a ground truth diagram of a port SAR image, where the blue target box represents the ground truth value of the ship; please refer to [link / reference]. Figure 4 The image shows a schematic diagram of the detection results from the YOLOv8m-OBB baseline model. It can be seen that multiple interference terms exist in the detection results. Please participate... Figure 5 The diagram shows the detection results of the detection network of this invention, and it can be seen that the detection results are consistent with the true values.
[0050] The embodiments of this invention also demonstrate stable recognition capabilities for different types of ships. As shown in Table 2, the recognition accuracy is highest for container ships with significant metallic reflectivity, reaching 90.30% at mAP@0.5; for oil tankers with weaker scattering characteristics, the recognition accuracy is 82.10%; and for other ship categories with diverse structural features, a recognition accuracy of 80.10% is still achieved even with significant differences in sample appearance, indicating that the model of this invention has good class differentiation and generalization capabilities.
[0051] Table 2: In the full-view large-scale image processing test, the slice detection and post-processing workflow designed in this embodiment of the invention demonstrated good engineering applicability. Ten port full-view SAR images with an average size exceeding 10000×10000 pixels were processed, with an average processing time of 41.3 seconds per image. Model inference time accounted for 68% of the processing time, and post-processing time accounted for 32%. Through the overlapping slice and rotated bounding box NMS strategy, the problems of target breakage and duplicate detection were effectively solved, and the overall recognition accuracy on full-view images was improved by approximately 2.1 percentage points compared to direct inference.
[0052] To verify the model's generalization ability, cross-band tests were conducted on C-band, X-band, and Ka-band SAR images. Without any fine-tuning, the model of this embodiment suppressed the false alarm rate and misidentification rate to below 20% on the test sets of the three bands, demonstrating that the model has good adaptability and robustness to different SAR imaging bands.
[0053] In summary, this invention, by introducing the EMA attention mechanism, the BiFPN feature fusion network, and the dynamic hybrid loss function, and combining them with a complete engineering processing flow, achieves a comprehensive improvement in accuracy, robustness, and practicality in port SAR ship target identification tasks, providing an effective technical solution for intelligent port monitoring.
[0054] Please refer to Figure 6 This invention provides a ship classification and identification device for port SAR images, the device comprising: The construction unit 600 is used to replace the feature pyramid network in the YOLOv8m-OBB network with a bidirectional feature pyramid network (BiFPN), and to embed a multi-scale attention module (EMA) between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain a detection network. The BiFPN is used to perform bidirectional cross-scale fusion of the multi-scale features extracted by the backbone network to generate a fused feature map that integrates shallow detail features and deep semantic features. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of key scattering regions of the ship. Training unit 602 is used to train the detection network using a dynamic hybrid loss function to obtain a trained detection network; The identification unit 604 is used to classify and identify the SAR image of the port to be detected using a trained detection network, and obtain the classification and identification results; the classification and identification results include the rotated bounding box, ship category and confidence level.
[0055] In one embodiment of the present invention, the multi-scale attention enhancement of the fused feature map includes: dividing the fused feature map into multiple groups in the channel dimension, performing convolution operations at different scales on each group to simultaneously extract local details and contextual information; using learnable channel attention weights to perform weighted fusion of the outputs of each group to obtain multi-scale aggregated features; and using a spatial attention mechanism to perform spatial recalibration of the multi-scale aggregated features.
[0056] In one embodiment of the present invention, the spatial recalibration of multi-scale aggregated features using a spatial attention mechanism includes: extracting spatial responses using global average pooling and max pooling, and generating a spatial attention map through convolution; and determining the product of the spatial attention map and the multi-scale aggregated features as the output feature map after spatial recalibration.
[0057] In one embodiment of the present invention, the dynamic hybrid loss function is a weighted joint loss of classification loss and regression loss: in, The classification loss is the total loss. The regression loss is used to measure the difference between the predicted class and the true class. Used to measure the positional deviation between the anchor box and the target box; the weighting coefficients of the classification loss. Weighting coefficients of regression loss The model is dynamically adjusted during the training process to enhance classification constraints in the early stages of training and bounding box regression constraints in the later stages of training, thereby achieving collaborative optimization of classification and localization tasks.
[0058] In one embodiment of the present invention, the regression loss for: in, The dynamic focusing coefficient is determined by the degree of group popularity. control, and For hyperparameters; This is the initial regression loss; The initial regression loss used to amplify the anchor box is such that the greater the overlap between the anchor box and the target box, the less attention is paid to the distance between the center points. The IoU loss is separated from the computation graph and does not participate in gradient backpropagation; and Here are the x and y coordinates of the center point of the target bounding box; and The width and height are the minimum bounding boxes corresponding to the anchor box and the target box, respectively. The superscript * indicates that the corresponding parameters do not participate in gradient updates.
[0059] In one embodiment of the present invention, the classification and recognition of the port SAR image to be detected using the trained detection network includes: slicing the port SAR image to be detected to obtain multiple slices to be detected; inputting each slice to be detected into the detection network to obtain the classification and recognition results of each slice; mapping the classification and recognition results of each slice to be detected to the original coordinate system of the port SAR image to be detected, and eliminating redundant boxes to obtain the final ship classification and recognition results.
[0060] It should be noted that the ship classification and identification device for port SAR images provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the ship classification and identification device for port SAR images provided in the above embodiments and the ship classification and identification method embodiments for port SAR images belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0061] Embodiments of this application also provide a computer device, please refer to... Figure 7The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, at least one program, code set or instruction set being loaded and executed by the processor to implement the ship classification and identification method for port SAR images provided in the above-described method embodiments.
[0062] The embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the ship classification and identification method for port SAR images provided in the above-described method embodiments.
[0063] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the ship classification and identification methods for port SAR images described in the above embodiments.
[0064] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.
[0065] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0066] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0067] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for ship classification and identification in port SAR images, characterized in that, The method includes: The feature pyramid network in the YOLOv8m-OBB network is replaced with a bidirectional feature pyramid network (BiFPN), and a multi-scale attention module (EMA) is embedded between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain the detection network. The BiFPN is used to perform bidirectional cross-scale fusion of the multi-scale features extracted by the backbone network to generate a fused feature map that integrates shallow detail features and deep semantic features. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of key scattering regions of the ship. The detection network is trained using a dynamic hybrid loss function to obtain a trained detection network; The trained detection network is used to classify and identify the SAR image of the port to be detected, and the classification and identification results are obtained. The classification and identification results include the rotated bounding box, ship category and confidence level.
2. The method according to claim 1, characterized in that, The multi-scale attention enhancement of the fused feature map includes: The fused feature map is divided into multiple groups along the channel dimension, and each group is subjected to convolution operations at different scales to extract local details and contextual information simultaneously. By using learnable channel attention weights to weight and fuse the outputs of each group, multi-scale aggregated features are obtained. Spatial recalibration of multi-scale aggregated features is performed using a spatial attention mechanism.
3. The method according to claim 2, characterized in that, The spatial recalibration of multi-scale aggregated features using a spatial attention mechanism includes: Spatial response is extracted using global average pooling and max pooling, and spatial attention map is generated through convolution. The product of the spatial attention map and the multi-scale aggregated features is determined as the output feature map after spatial recalibration.
4. The method according to claim 1, characterized in that, The dynamic mixture loss function is a weighted joint loss of classification loss and regression loss: in, The classification loss is the total loss. The regression loss is used to measure the difference between the predicted class and the true class. Used to measure the positional deviation between the anchor box and the target box; the weighting coefficients of the classification loss. Weighting coefficients of regression loss The model is dynamically adjusted during the training process to enhance classification constraints in the early stages of training and bounding box regression constraints in the later stages of training, thereby achieving collaborative optimization of classification and localization tasks.
5. The method according to claim 4, characterized in that, The regression loss for: in, The dynamic focusing coefficient is determined by the degree of group popularity. control, and For hyperparameters; This is the initial regression loss; The initial regression loss used to amplify the anchor box is such that the greater the overlap between the anchor box and the target box, the less attention is paid to the distance between the center points. The IoU loss is separated from the computation graph and does not participate in gradient backpropagation; and Here are the x and y coordinates of the center point of the target bounding box; and The width and height are the minimum bounding boxes corresponding to the anchor box and the target box, respectively. The superscript * indicates that the corresponding parameters do not participate in gradient updates.
6. The method according to any one of claims 1-5, characterized in that, The process of classifying and recognizing the SAR image of the port to be detected using a trained detection network includes: The SAR image of the port to be detected is sliced to obtain multiple slices to be detected. Each slice to be detected is input into the detection network to obtain the classification and recognition results of each slice to be detected; The classification and recognition results of each slice to be detected are mapped to the original coordinate system of the SAR image of the port to be detected, and redundant boxes are eliminated to obtain the final ship classification and recognition results.
7. A ship classification and identification device for port SAR images, characterized in that, The device includes: A construction unit is used to replace the feature pyramid network in the YOLOv8m-OBB network with a bidirectional feature pyramid network (BiFPN), and to embed a multi-scale attention module (EMA) between each detection output of the YOLOv8m-OBB network and the output of the BiFPN to obtain a detection network. The BiFPN is used to perform bidirectional cross-scale fusion of the multi-scale features extracted by the backbone network to generate a fused feature map that integrates shallow detail features and deep semantic features. The EMA is used to perform multi-scale attention enhancement on the fused feature map to focus on and enhance the response of key scattering regions of the ship. The training unit is used to train the detection network using a dynamic hybrid loss function to obtain a trained detection network. The identification unit is used to classify and identify the SAR image of the port to be detected using a trained detection network, and obtain the classification and identification results; the classification and identification results include the rotated bounding box, ship category and confidence level.
8. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-6.
Citation Information
Cited By
Multi-scale ship target detection method based on heterogeneous backbone fusion and noise suppression
CN122049720A