Ship detection method based on edge semantic fusion and contrast feature aggregation
Through the methods of edge semantic fusion and contrast feature aggregation, the semantic ambiguity problem of ship detection in SAR images is solved, the distinguishability of targets and backgrounds is enhanced, the detection accuracy and generalization ability are improved, and it is suitable for complex marine scenes.
Patent Information
- Application Number
- CN202510662317.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-05-22
AI Technical Summary
Existing SAR ship detection methods find it difficult to strike a balance between detection accuracy, computational efficiency, and generalization capabilities for marine scenarios. Traditional methods make strict assumptions about clutter distribution and have limited adaptability, while deep learning methods lack the ability to locate edges in SAR images, resulting in semantic ambiguity and noise amplification.
A method based on edge semantic fusion and contrast feature aggregation is adopted. Through a multi-scale edge feature generator and a contrast-driven feature aggregation module, combined with a dynamic fusion head, the distinguishability of the target and the background is enhanced. The improved C3k2 module and Haar wavelet transform are used to improve the edge information extraction and feature fusion capabilities.
It improves the accuracy and robustness of ship detection in SAR images, enhances cross-model generalization capabilities, and significantly improves detection performance in complex marine scenes.
Smart Images

Figure CN120198682B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship detection, and provides a ship detection method based on edge semantic fusion and contrast feature aggregation. Background Art
[0002] Synthetic Aperture Radar (SAR) is a high-resolution imaging technology that provides detailed radar imagery in all weather conditions, unaffected by cloud cover or illumination. However, ship detection in SAR imagery remains challenging due to factors such as low target-background contrast, speckle noise, and complex background clutter. For example, in coastal areas, clutter generated by waves and land reflections complicates target identification, while misclassification of wave crests or buoys as ships leads to high false alarm rates. In congested waterways, overlapping radar return signals from multiple ships hinder accurate separation. Furthermore, detecting small or distant vessels in the open ocean is challenging because weak radar returns are easily masked by sea clutter, often resulting in missed detections. Existing SAR ship detection methods fall into two main paradigms: traditional constant false alarm rate (CFAR)-based methods and deep learning-driven detectors. However, both paradigms struggle to strike a balance between detection accuracy, computational efficiency, and generalization across various maritime scenarios.
[0003] Traditional CFAR detectors, such as those based on the generalized gamma distribution and bilateral CFAR, rely on statistical models to distinguish targets from background clutter. While effective in controlled environments, these methods have limited adaptability to real-world scenarios due to their reliance on handcrafted features and strict assumptions about clutter distribution. Furthermore, they are unable to address inherent challenges of SAR imagery, such as discontinuous target boundaries and spatially correlated speckle noise, which are exacerbated in dynamic sea conditions.
[0004] The advent of deep learning has transformed SAR ship detection, with frameworks such as YOLO, Faster R-CNN (Faster Region-based Convolutional Neural Network), and anchor-free detectors achieving success in the visible light domain. Despite these advances, traditional deep learning architectures still suffer from key limitations when applied to SAR imagery. Specifically, SAR imagery is typically single-channel and lacks texture information, requiring precise edge localization to accurately delineate targets—a capability that is underappreciated in networks optimized for multispectral input. Furthermore, popular attention mechanisms (such as CBAM and RAM) often overemphasize local details, inadvertently amplifying background noise and exacerbating semantic ambiguity in complex scenes.
[0005] Edge detection, a cornerstone of computer vision, plays a key role in SAR ship detection by separating target outlines from cluttered backgrounds. Traditional edge operators (such as Sobel and Canny) and deep learning-based methods (such as HED and DexiNed) have been widely used. However, these methods are primarily designed for natural images with clear foreground and background distinctions and are not suitable for the unique characteristics of SAR images. SAR images typically resemble a collection of background objects with subtle intensity gradients, making it difficult for traditional edge detectors to distinguish true ship boundaries from artifacts generated by noise. Summary of the Invention
[0006] The present invention aims to address at least one of the technical problems existing in the related art. To this end, the present invention provides a ship detection method based on edge semantic fusion and contrast feature aggregation. This method addresses the semantic ambiguity caused by texture-poor SAR input, enhances the distinguishability of targets and backgrounds, and highlights the robust cross-model generalization capabilities of the present invention.
[0007] The present invention provides a ship detection method based on edge semantic fusion and contrast feature aggregation, comprising the following steps:
[0008] S1: Acquire and preprocess an image to obtain a preprocessed image;
[0009] S2: Building a ship detection model based on the basic model, the ship detection model includes an edge semantic fusion backbone network, a contrast-driven feature aggregation module, and a dynamic fusion head;
[0010] S3: Setting training parameters and using the preprocessed images to train the ship detection model to obtain a ship detection training model;
[0011] S4: Input the detection image to be detected into the ship detection training model to obtain the detection result.
[0012] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the basic model includes a YOLO model and an RT-DETR model (Real-Time Detection Transformer).
[0013] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the edge semantic fusion backbone network includes a basic feature extractor and a multi-scale edge feature generator.
[0014] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the workflow of the multi-scale edge feature generator is as follows:
[0015] S11: Convolve the input image data to obtain an input feature map;
[0016] S12: performing edge information fusion on the input feature map to obtain a first edge information feature;
[0017] S13: performing edge information fusion on the first edge information feature to obtain a second edge information feature;
[0018] S14: Perform edge information fusion on the second edge information feature to obtain a third edge information feature.
[0019] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the process of edge information fusion is as follows:
[0020] S101: Define the Sobel horizontal operator and Sobel vertical operator :
[0021]
[0022] is the transpose of the matrix;
[0023] S102: Performing horizontal Sobel convolution on the input data according to the Sobel horizontal operator to obtain a horizontal Sobel result;
[0024] S103: performing vertical Sobel convolution on the input feature map according to the Sobel vertical operator to obtain a vertical Sobel result;
[0025] S104: Multiply the horizontal Sobel result and the vertical Sobel result bit by bit to obtain edge information features.
[0026] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the steps of the basic feature extractor are:
[0027] S111: Inputting the input feature map into the C3k2 module for feature extraction to obtain a first C3k2 result, and performing edge-guided feature fusion on the first C3k2 result and the first edge information feature to obtain a first feature map;
[0028] S112: Input the first feature map into the C3k2 module for feature extraction to obtain a second C3k2 result, and perform edge-guided feature fusion on the second C3k2 result and the second edge information feature to obtain a second feature map;
[0029] S112: Input the second feature map into the C3k2 module for feature extraction to obtain a third C3k2 result, and perform edge-guided feature fusion on the third C3k2 result and the third edge information feature to obtain a third feature map.
[0030] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the edge-guided feature fusion process is as follows:
[0031] S121: Pooling the input feature map to obtain a first pooling result;
[0032] S122: Pooling the first pooling result, and then Convolution to obtain the second pooling result;
[0033] S123: Pool the second pooling result, and then Convolution, get the third pooling result;
[0034] S124: Multiply the edge feature, the first pooling result, the second pooling result, the third pooling result and the C3k2 result bit by bit to obtain an edge guide intermediate value;
[0035] S125: Convolve the edge-guided median value to obtain a feature map.
[0036] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the process of the contrast-driven feature aggregation module is as follows:
[0037] S21: performing Haar wavelet transform on the third feature map to obtain a decomposed feature map;
[0038] S22: Inputting the decomposed feature map into a CDFA image processing module to obtain a weighted feature map.
[0039] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the dynamic fusion head integrates a bidirectional feature pyramid for multi-scale feature fusion, and the bidirectional feature pyramid includes a feature pyramid network and a path aggregation network.
[0040] According to a ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention, the dynamic fusion head uses an oriented bounding box detection head instead of an axis-aligned bounding box.
[0041] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0042] The ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention solves the semantic ambiguity problem caused by SAR texture-poor input by integrating the two modules of edge semantic fusion and contrast-driven feature fusion into a new framework, enhances the distinguishability of targets and backgrounds, and highlights the robust cross-model generalization capability of the present invention.
[0043] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 It is a flow chart of the ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention.
[0046] Figure 2 These are the ablation experiment results of the ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention under different data sets.
[0047] Figure 3 This is a visualization experiment comparison diagram of the ship detection method based on edge semantic fusion and contrast feature aggregation provided by the present invention. DETAILED DESCRIPTION
[0048] To make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below. Obviously, the embodiments described are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0049] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0050] The following combination Figures 1 to 3 The present invention is described.
[0051] Example
[0052] like Figure 1 As shown, an embodiment of the present invention provides a ship detection method based on edge semantic fusion and contrast feature aggregation, comprising the following steps:
[0053] S1: Acquire and preprocess an image to obtain a preprocessed image;
[0054] S2: Building a ship detection model based on the basic model, the ship detection model includes an edge semantic fusion backbone network, a contrast-driven feature aggregation module, and a dynamic fusion head;
[0055] S3: Setting training parameters and using the preprocessed images to train the ship detection model to obtain a ship detection training model;
[0056] S4: Input the detection image to be detected into the ship detection training model to obtain the detection result.
[0057] Specifically, the basic models include the YOLO model and the RT-DETR model.
[0058] Specifically, the edge semantic fusion backbone network consists of a dual-path structure consisting of a basic feature extractor and a multi-scale edge feature generator. The basic feature extractor is constructed using the improved C3k2 module as an example. This path generates hierarchical semantic features through four downsampling stages. Each module uses depthwise separable convolution to balance computational efficiency and feature richness. If used in other models such as RT-DETR, the feature extractor can be replaced. The multi-scale edge generator uses cascaded Sobel kernels and adaptive pooling operations to extract noise-resistant edge features from shallow convolutional layers. It outputs edge feature maps at three scales, which are then fused with the semantic features of the backbone network.
[0059] The Multi-Scale Edge Generator (MSEG) aims to improve the network's ability to capture edge information. This module first uses Sobel convolution (SobelConv) to extract edge information from the input feature map. This is then progressively downsampled using max pooling to generate multi-scale edge feature maps. These feature maps are then resized using 1×1 convolution to ensure compatibility with the backbone network. This multi-scale edge information compensates for the shortcomings of traditional convolutional neural networks in capturing fine edge details.
[0060] Specifically, the steps of the multi-scale edge feature generator are:
[0061] S11: Convolve the input image data to obtain an input feature map;
[0062] S12: performing edge information fusion on the input feature map to obtain a first edge information feature;
[0063] S13: performing edge information fusion on the first edge information feature to obtain a second edge information feature;
[0064] S14: Perform edge information fusion on the second edge information feature to obtain a third edge information feature.
[0065] Specifically, the process of edge information fusion is as follows:
[0066] S101: Define the Sobel horizontal operator and Sobel vertical operator :
[0067]
[0068]
[0069] is the input image, is the convolution operation, is the transpose of the matrix;
[0070] Similarly, the gradient amplitude can be obtained and gradient angle
[0071]
[0072]
[0073] Strong edges, characterized by high gradient magnitudes, typically appear in areas with significant color or texture changes, while weak edges with lower magnitudes represent smoother areas. The output of the Sobel convolution combines information from both directions to highlight edge responses in the image.
[0074] S102: Performing horizontal Sobel convolution on the input data according to the Sobel horizontal operator to obtain a horizontal Sobel result;
[0075] S103: performing vertical Sobel convolution on the input feature map according to the Sobel vertical operator to obtain a vertical Sobel result;
[0076] The vertical and horizontal Sobel kernels are defined as [3,3] matrices. These kernels are then expanded to three dimensions to meet the requirements of PyTorch convolutional layers. Notably, the Sobel kernels are fixed and do not participate in backpropagation updates. The weights of the convolutional layer are assigned to the Sobel_X and Sobel_Y kernels for horizontal and vertical edge detection, respectively. The Sobel_X kernel emphasizes horizontal brightness changes and enhances horizontal edge responses by alternating positive and negative coefficients in the middle row. The Sobel_Y kernel detects vertical brightness gradients and strengthens vertical edge features by alternating positive and negative coefficients in the middle column. Using depthwise separable convolutions allows the Sobel kernel to be applied independently to each input channel, without sharing convolution weights and reducing computational effort.
[0077] S104: Multiply the horizontal Sobel result and the vertical Sobel result bit by bit to obtain edge information features.
[0078] Specifically, the workflow of the basic feature extractor is as follows:
[0079] S111: Inputting the input feature map into the C3k2 module for feature extraction to obtain a first C3k2 result, and performing edge-guided feature fusion on the first C3k2 result and the first edge information feature to obtain a first feature map;
[0080] S112: Input the first feature map into the C3k2 module for feature extraction to obtain a second C3k2 result, and perform edge-guided feature fusion on the second C3k2 result and the second edge information feature to obtain a second feature map;
[0081] S112: Input the second feature map into the C3k2 module for feature extraction to obtain a third C3k2 result, and perform edge-guided feature fusion on the third C3k2 result and the third edge information feature to obtain a third feature map.
[0082] The feature map after Sobel edge extraction will undergo continuous maximum pooling operations. The size of the feature map after each pooling is halved to generate edge features of different scales. The multi-scale feature map can preserve edge information at different resolutions.
[0083] Specifically, the edge-guided feature fusion process is as follows:
[0084] S121: Pooling the input features to obtain a first pooling result;
[0085] S122: Pooling the first pooling result, and then Convolution to obtain the second pooling result;
[0086] S123: Pool the second pooling result, and then Convolution, get the third pooling result;
[0087] S124: Multiply the edge feature, the first pooling result, the second pooling result, the third pooling result and the C3k2 result bit by bit to obtain an edge guide intermediate value;
[0088] S125: Convolve the edge-guided median value to obtain a feature map.
[0089] The choice of downsampling needs to be more cautious. The goal of this invention is to retain and enhance edge information while downsampling. MaxPool (maximum pooling layer) can retain the strongest features of local areas and better reflect edge information. AvgPool (average pooling layer) is more suitable for scenarios that require smoothing or homogenizing features, but it does not perform as well as MaxPool in retaining details and edge information. Different feature maps are adjusted to the same dimension of feature maps of different scales through 1x1 convolution, and cross-channel fusion of edge information and ordinary convolution features is performed. The fused features are then further extracted through 3x3 convolution to enhance the model's ability to capture local details, and adjusted to the output feature dimension through 1x1 convolution.
[0090] Specifically, the process of the contrast-driven feature aggregation module is as follows:
[0091] S21: Performing Haar wavelet transform on the third feature map to obtain a decomposed feature map.
[0092] Single edge detection methods often perform poorly in complex scenes. Combining the Haar wavelet transform and the contrast-driven feature aggregation (CDFA) image processing module, the foreground and background information are compared through the attention mechanism. The attention mechanism can dynamically adjust the weight of features and enhance the expressiveness of important areas.
[0093] First, four filters are defined, corresponding to the low-frequency (LL), horizontal (LH), vertical (HL), and diagonal (HH) directions. The LL filter retains low-frequency information through a double low-pass filter. The LH and HL filters each focus on high-frequency signals in a single direction, reflecting their directional differences. The HH filter retains high-frequency signals in both directions and responds to sharp cross-signals. The filter weights are initialized using hard-coded weights and are not trained by default. The input feature map is convolved to obtain feature maps in four directions, which are then decomposed into low-frequency and high-frequency features. High-frequency features capture detailed information, and attention weights are applied to their values to obtain weighted foreground features. Low-frequency features capture overall structural information, and attention weights are applied to these weighted foreground features to further enhance the features.
[0094] S22: Inputting the decomposed feature map into a CDFA image processing module to obtain a weighted feature map.
[0095] The attention mechanism in CDFA operates implicitly via convolutional layers, deriving query and key information directly from decomposed feature maps (high-frequency signals are represented by fg and low-frequency signals by bg), rather than through explicit linear layers. High-frequency and low-frequency feature maps are first randomly generated and then concatenated to form a fused feature map. Next, two convolutional layers—query convolution and key convolution—are defined to generate the query and key, respectively. This approach avoids the computational overhead of traditional attention mechanisms while maintaining the ability to dynamically adjust feature weights. The downsampled feature maps are projected into the attention weight space via linear layers, enabling weight generation directly from the feature maps. This design accommodates the multi-scale nature of images and reduces computational complexity.
[0096] Local features are extracted from the feature map after Haar wavelet transform and attention-weighted aggregation. Stacked convolutions are then used to gradually integrate higher-level semantic information while maintaining the spatial dimensions of the input and output. The final output feature map combines low- and high-frequency information, and the attention mechanism weights important regions, better capturing both the global structure and local details of the image. Combined with the previously obtained edge information, the CDFA module improves the model's adaptability to complex scenes and ensures more accurate detection results.
[0097] Specifically, the dynamic fusion head integrates a bidirectional feature pyramid for multi-scale feature fusion, and the bidirectional feature pyramid includes a feature pyramid network and a path aggregation network.
[0098] Specifically, the dynamic fusion head replaces the axis-aligned bounding box with an oriented bounding box detection head. Dynamic fusion weights features according to their importance, significantly enhancing the separation of objects from background. Furthermore, to address the issue of arbitrary orientation of ships in synthetic aperture radar (SAR) imagery, an oriented bounding box (OBB) detection head replaces the traditional axis-aligned bounding box (AABB). The OBB detection head can predict rotation angles and coordinates, enabling precise localization of rotating objects such as ships. It more closely follows the ship's outline and reduces background interference, thereby improving detection accuracy.
[0099] To verify the performance of the proposed target detection network, we conducted ablation experiments on three datasets: SSDD (SAR Ship Detection Dataset), HRSID (High Resolution SAR Images Dataset), and RSDD-SAR (Rotated Ship Detection Dataset in SAR Images), using three benchmark models: RT-DETR, YOLOv11, and YOLOv8, and compared them with the existing SAR image ship detection network.
[0100] In this embodiment of the present invention, the dataset is divided into 928 training images and 232 test images in a ratio of 8:2. This division ensures a balanced distribution of data and facilitates fair comparison with other methods. The dataset covers ship targets both nearshore and offshore, presenting a variety of scenarios, which challenges the robustness of the detection algorithm. This experiment is based on the NVIDIA GeForce RTX 3080Ti graphics card and adopts a cosine learning rate decay strategy. The learning rate and momentum coefficient are configured to 0.001 and 0.937 respectively. The initial learning rate is set to 0.001, and the minimum learning rate is defined as 0.01 times the initial learning rate.
[0101] The performance of the experimental method is mainly measured by the average precision Evaluation is performed, and precision and recall are used as auxiliary evaluation indicators. Precision refers to the proportion of correctly detected positive samples to all detected positive samples, and recall refers to the proportion of correctly detected positive samples to all true positive samples. The calculation formula is as follows:
[0102]
[0103]
[0104] in, For accuracy, is the recall rate, is the number of positive samples detected correctly; Indicates the number of background areas that are falsely detected as targets; Represents the number of true targets that are not detected. The average precision is obtained by integrating the precision-recall curve, and its calculation formula is:
[0105]
[0106] in, Indicates the recall rate The accuracy under The higher the value, the better the performance of the target detection algorithm. Since the dataset used in this study only contains a single category (ship target), The value is value. It is the average precision calculated under different intersection over union (IoU) thresholds, and its calculation formula is:
[0107]
[0108] in The range is from 0.50 to 0.95, with increments of 0.05. is the step length ordinal number. Compared with the single IoU threshold as the evaluation standard, Calculate the values under 10 different IoU thresholds The evaluation method places higher demands on the positioning accuracy of the algorithm.
[0109] In the embodiment of the present invention, RT-DETR, YOLOv11 and YOLOv8 are used as the basic models, and systematic ablation experiments are carried out to evaluate the performance of the proposed multi-scale edge feature generator (MSEG) and contrast-driven feature aggregation module (CDFA), and verify their effectiveness for target detection tasks. Figure 2 As shown, Figure 2 Detailed experimental results are shown. As the main evaluation metric, it is used to measure the detection accuracy of the model. In the figure, the blue column represents the addition of only the CDFA module, MEF represents the addition of only the MSEG module, and COMP represents the addition of both modules. Figure 2 (a) is based on the RT-DETR model. Figure 2 (b) is based on the YOLOv11 model. Figure 2(c) is based on YOLOv8. RT-DETR does not use an OBB detection head. MSEG significantly improves detection in offshore multi-target scenarios. The RT-DETR model achieves a 4.10% mAP gain on the Inshore dataset, the largest gain among all models. This demonstrates that edge features are crucial for low-contrast offshore ship scenes. The generated multi-scale edge features effectively enhance the distinction between small targets (offshore ships) and complex backgrounds (waves, docks). The CDFA module demonstrates performance improvements across various basic algorithms and scenarios, demonstrating its broad application potential and adaptability. Experimental results show that both MSEG and CDFA modules significantly improve model performance across various datasets, with the RT-DETR model performing particularly well. The MSEG module significantly enhances detection capabilities by enhancing multi-scale edge features, while the CDFA module is more suitable for scenarios with dense targets and significant background interference. The performance improvement is even more pronounced when both MSEG and CDFA are added simultaneously, demonstrating the synergistic effect of these two modules in multi-scale feature fusion and edge feature extraction.
[0110] Figure 3 This article compares the detection performance of different module combinations in typical scenes from the SSDD dataset. The improvements brought by the modules can be more intuitively seen from the image details. From left to right, the detection results are for the base model (Base), adding only the MSEG module (MSEG), adding only the CDFA module (CDFA), and the combined method (COMP). Each row corresponds to inshore and offshore scenes from the SSDD dataset, covering the challenges of detecting small objects, large objects, and densely packed objects. Red circles indicate false detections, yellow circles indicate missed objects, and green circles indicate detection boxes with large overlapping areas. In the inshore and offshore small object scenes in the third and fifth rows, the base model misses many tiny objects. Adding the MSEG module reduces the small object miss rate, and the number of blue detection points increases significantly. In the dense offshore object separation scene in the second row, the base model struggles to accurately separate densely packed objects. Adding the CDFA module allows the detection boxes to more closely fit the outlines of the packed objects, significantly improving the overlap. In the first row of scenarios for locating large offshore targets, the MSEG module's detection box may capture more true targets but increase false alarms. The CDFA module effectively mitigates these false alarms. Overall, MSEG significantly enhances edge sensitivity, making it particularly suitable for small targets and low-contrast scenarios, but it can introduce false alarms. CDFA optimizes detection confidence through dynamic feature weighting, effectively mitigating false alarms and improving boundary fit. When these two modules are used together, they can significantly improve detection accuracy and completeness while preventing missed detections.
[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0112] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion 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 computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
[0114] It should be noted that the embodiments of the present disclosure can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system such as a microprocessor or dedicated hardware. Those skilled in the art will understand that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such code is provided on a programmable memory or a data carrier such as an optical or electronic signal carrier.
[0115] In addition, although the operations of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flow chart can change the order of execution. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps. It should also be noted that the features and functions of two or more devices according to the present disclosure can be embodied in one device. Conversely, the features and functions of a device described above can be further divided into being embodied by multiple devices.
[0116] Although the present disclosure has been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A ship detection method based on edge semantic fusion and contrast feature aggregation, characterized in that: The following steps are involved: S1: Acquire and preprocess an image to obtain a preprocessed image; S2: A ship detection model is established based on the basic model. The ship detection model includes an edge semantic fusion backbone network, a contrast-driven feature aggregation module, and a dynamic fusion head. The edge semantic fusion backbone network includes a basic feature extractor and a multi-scale edge feature generator. The workflow of the multi-scale edge feature generator is as follows: S11: Convolve the input image data to obtain an input feature map; S12: performing edge information fusion on the input feature map to obtain a first edge information feature; S13: performing edge information fusion on the first edge information feature to obtain a second edge information feature; S14: performing edge information fusion on the second edge information feature to obtain a third edge information feature; The workflow of edge information fusion is as follows: S101: Define the Sobel horizontal operator and Sobel vertical operator : is the transpose of the matrix; S102: Performing horizontal Sobel convolution on the input data according to the Sobel horizontal operator to obtain a horizontal Sobel result; S103: performing vertical Sobel convolution on the input feature map according to the Sobel vertical operator to obtain a vertical Sobel result; S104: Multiply the horizontal Sobel result and the vertical Sobel result bit by bit to obtain edge information features; The steps of the basic feature extractor are: S111: Inputting the input feature map into the C3k2 module for feature extraction to obtain a first C3k2 result, and performing edge-guided feature fusion on the first C3k2 result and the first edge information feature to obtain a first feature map; S112: Input the first feature map into the C3k2 module for feature extraction to obtain a second C3k2 result, and perform edge-guided feature fusion on the second C3k2 result and the second edge information feature to obtain a second feature map; S113: Input the second feature map into the C3k2 module for feature extraction to obtain a third C3k2 result, and perform edge-guided feature fusion on the third C3k2 result and the third edge information feature to obtain a third feature map; The edge-guided feature fusion process is as follows: S121: Pooling the input feature map to obtain a first pooling result; S122: Pooling the first pooling result, and then Convolution to obtain the second pooling result; S123: Pool the second pooling result, and then Convolution, get the third pooling result; S124: Multiply the edge feature, the first pooling result, the second pooling result, the third pooling result and the C3k2 result bit by bit to obtain an edge guide intermediate value; S125: Convolving the edge-guided median value to obtain a feature map; S3: Setting training parameters and using the preprocessed images to train the ship detection model to obtain a ship detection training model; S4: Input the detection image to be detected into the ship detection training model to obtain the detection result.
2. A ship detection method based on edge semantic fusion and contrast feature aggregation according to claim 1, characterized in that: The basic models include the YOLO model and the RT-DETR model.
3. The ship detection method based on edge semantic fusion and contrast feature aggregation according to claim 1, characterized in that: The process of the contrast-driven feature aggregation module is as follows: S21: performing Haar wavelet transform on the third feature map to obtain a decomposed feature map; S22: Inputting the decomposed feature map into a CDFA image processing module to obtain a weighted feature map.
4. The ship detection method based on edge semantic fusion and contrast feature aggregation according to claim 1, characterized in that: The dynamic fusion head integrates a bidirectional feature pyramid for multi-scale feature fusion, and the bidirectional feature pyramid includes a feature pyramid network and a path aggregation network.
5. The ship detection method based on edge semantic fusion and contrast feature aggregation according to claim 1, characterized in that: The dynamic fusion head uses an oriented bounding box detection head instead of an axis-aligned bounding box.
Citation Information
Patent Citations
Automatic quantitative analysis method and system for lung digital pathological image
CN113222012A
High-resolution remote sensing image building extraction method
CN118279762A