A ship detection method based on reconstruction convolution and enhanced feature fusion
By combining reconstructed convolution with enhanced feature fusion, the problem of accurate localization and classification of ships in complex backgrounds and at multiple scales is solved, achieving efficient ship target detection that is suitable for embedded devices.
Patent Information
- Application Number
- CN202410980348.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Existing ship inspection methods struggle to accurately target ships in complex environments and face multi-scale issues, leading to frequent missed and false detections.
We employ a method that combines reconstructed convolution with enhanced features. By reconstructing convolutions spatially and through channels to eliminate redundancy, and combining it with the NL-Block module to fuse high-level semantic information and low-level feature information, we use a one-stage detection algorithm to predict and classify target boxes.
It improves the accuracy and robustness of ship detection, effectively identifies ship targets in complex backgrounds and multi-scale conditions, and is suitable for deployment in resource-constrained embedded devices.
Smart Images

Figure CN118942052B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship target detection technology, and in particular to a ship detection method based on the fusion of reconstructed convolution and enhanced features. Background Technology
[0002] With the development of information technology, real-time ship detection and intelligent tracking have been widely applied in the field of maritime supervision, greatly improving the efficiency of maritime supervision. However, traditional detection methods generally suffer from slow training speeds and an inability to handle ship targets in complex backgrounds, making it difficult to achieve high-precision ship detection and tracking. In recent years, with the development of deep learning, using convolutional neural network models for ship detection has become the mainstream method. Although deep learning-based ship detection methods have made breakthrough progress, due to the diverse ship sizes, variable climate environments, and complex port backgrounds, existing ship detection algorithms still suffer from many cases of missed detections and false detections. How to improve the robustness of ship detection models is currently a hot topic and a challenge in ship detection research.
[0003] Currently, deep learning-based object detection algorithms are mainly divided into two categories:
[0004] (1) Two-stage object detection algorithms. In the first stage, candidate boxes that may contain objects are generated using a Region Proposal Network (RPN) or other methods. These candidate boxes represent potential object regions in the image. In the second stage, these candidate boxes are fed into a classifier for object classification and position fine-tuning, ultimately yielding the object detection result. Typical two-stage object detection algorithms include R-CNN and Mask R-CNN.
[0005] (2) One-stage object detection algorithms process the entire image directly to complete the object classification and localization tasks. This method is simple and efficient, and can perform object detection in real time, making it particularly suitable for applications where detection speed is critical. Representative one-stage object detection algorithms include SSD and YOLO. Although one-stage algorithms may sacrifice some accuracy in some cases, their fast detection speed makes them widely used in real-time object detection tasks.
[0006] One-stage deep learning-based ship inspection methods outperform two-stage methods in handling complex scenarios, providing a reliable solution for maritime supervision. However, due to the diversity of ship dimensions, the variability of climate environments, and the complexity of port contexts, ship inspection still faces the following challenges:
[0007] 1. The model struggles to accurately focus on ship targets in complex backgrounds, causing ship feature information to be interfered with and become less obvious, thus affecting the accurate positioning and classification of ships. Traditional ship detection algorithms typically use only convolutional neural networks as the backbone feature extraction network for deep feature extraction. However, this approach may lead to feature redundancy in the network in both space and channels, reducing the model's performance and efficiency.
[0008] 2. Ship inspection faces multi-scale challenges. Previous ship inspection models typically employed feature pyramid fusion technology to address this issue. However, this simple fusion method may result in insufficient integration of deep and shallow features, failing to effectively utilize information from different levels of features and leading to missed detections in multi-scale ship inspections. Summary of the Invention
[0009] The purpose of this invention is to overcome the problems of existing models being unable to accurately focus on ship targets in complex backgrounds and the multi-scale nature of ship detection, and to provide a ship detection method based on the fusion of reconstructed convolution and enhanced features.
[0010] The objective of this invention can be achieved through the following technical solutions:
[0011] A ship detection method based on the fusion of reconstructed convolution and enhanced features, the method comprising the following steps:
[0012] Acquire images containing ship targets;
[0013] A feature extraction backbone network was used to extract features from images containing ship targets, resulting in features at three different scales.
[0014] Spatial and channel reconstruction convolutions are performed on the extracted features to eliminate spatial and channel redundancy, resulting in three feature layers;
[0015] The three feature layers are input into the NL-Block module to fuse high-level semantic information and low-level feature information, and output three feature maps.
[0016] The feature map is fed into the detection head of the first-stage detection algorithm for target bounding box prediction and classification, thus obtaining the ship detection results.
[0017] As a preferred technical solution, the spatial and channel reconstruction convolution performs feature separation and reconstruction operations on the spatial and channel aspects respectively to retain important spatial information and reduce redundancy between channels.
[0018] As a preferred technical solution, the specific steps for the spatial reconstruction are as follows:
[0019] Perform grouping and normalization operations on the input feature maps;
[0020] After normalization, a threshold is set to determine the feature layer, separating the feature layer W1 with rich spatial information from the feature layer W2 with less spatial information.
[0021] The separated feature layers are reconstructed, and the feature layers with rich spatial information are divided into W... 11 W 12 The feature layer with less spatial information is divided into two parts, W. 21 W 22 Two parts are used, and the spatially refined feature map X is obtained by cross-reconstruction using the following formula. w :
[0022] W 11 +W 22 =X w1
[0023] W 12 +W 21 =X w2
[0024] X w1 ∪X w2 =X w .
[0025] As a preferred technical solution, the specific steps for channel reconstruction are as follows:
[0026] Spatial refinement feature map X is obtained by reconstructing the space using hyperparameter α. w It is divided into two parts. One part has αC channels, which serves as the input X for rich feature extraction. up The other part is (α-1)C, which serves as a supplementary X for rich feature extraction. low ;
[0027] For feature extraction input X up Perform grouped convolution and pointwise convolution separately, and sum the results to obtain Y1, which is a supplement to X for rich feature extraction. low Perform pointwise convolution to obtain Y2;
[0028] Channel fusion is performed. Global average pooling is used to combine global spatial information and channel statistics. After Softmax processing, feature weight vectors β1 and β2 are obtained, and the output Y = β1Y1 + β2Y2 is obtained.
[0029] As a preferred technical solution, the feature fusion of high-level semantic information and low-level feature information specifically involves:
[0030] The three feature layers serve as shallow features, middle features, and deep features, respectively.
[0031] The NL-Block module is used to enhance and fuse shallow and deep features, as well as mid-level and deep features, respectively. Finally, three feature maps of the fused features and deep features are output.
[0032] As a preferred technical solution, the NL-Block module combines features containing fine-grained pixel information with features containing a larger receptive field by calculating the global dependency between high-level features and low-level features. The specific steps are as follows:
[0033] Adjust the high-level feature map to the same size as the low-level feature map to ensure that the high-level features and low-level features are aligned in spatial dimensions;
[0034] The adjusted high-level feature map and low-level feature map are each stretched into a one-dimensional vector, while retaining the feature information at each position in the feature map;
[0035] The similarity between high-level feature maps and low-level feature maps is used to measure the degree of correlation between low-level features and high-level features at each location;
[0036] Based on the similarity weights, a weighted sum is calculated at each location of the high-level feature map to obtain the fused feature representation.
[0037] As a preferred technical solution, during the training process of the one-stage detection algorithm, the overall loss function of the model adopts the classification loss L. class Boundary regression loss L local and confidence loss L obj The weighted sum is calculated using the following formula:
[0038]
[0039] Here, λ is the weight of the regression box loss, used to adjust the model's focus on the regression box loss.
[0040] As a preferred technical solution, the classification loss L class The calculation formula is as follows:
[0041]
[0042] Where N represents the total number of categories; x i y is the predicted value for the current category; i This represents the probability of the current category. This is the true value for the current category.
[0043] As a preferred technical solution, the bounding box regression loss L local Using CIOU, the calculation formula is as follows:
[0044]
[0045] Where ν is the aspect ratio similarity between the ground truth bounding box and the predicted bounding box; α is a balancing factor used to adjust the weight of aspect ratio similarity when calculating the loss; and IOU is the intersection-union ratio of the target bounding box.
[0046] As a preferred technical solution, the confidence loss L obj The calculation formula is as follows:
[0047]
[0048] C * =Sigmod(C)
[0049] Where N is the number of samples; γ is the balancing factor, used to balance the impact of positive and negative samples on the loss; It is the confidence level obtained after the predicted value C is processed by the Sigmoid function.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1) In ship detection tasks, the SCConv reconstructed convolution module brings a new approach to the design of convolutional neural networks. Traditional convolutional neural networks face the challenge of detecting multi-scale targets when handling ship detection tasks, requiring minimizing model complexity and computational cost while maintaining detection accuracy. The introduction of the SCConv module can effectively reduce the number of model parameters and computational complexity while maintaining model performance. By embedding the SCConv module into the convolutional neural network, it can replace traditional convolutional layers, thereby achieving better feature extraction results. In ship detection tasks, the SCConv module helps the network better capture the features of ship targets at different scales, improving detection accuracy and robustness. Furthermore, due to the lightweight and efficient nature of the SCConv module, ship detection models can still achieve excellent detection performance in resource-constrained environments, making them suitable for deployment on embedded or mobile devices.
[0052] 2) This invention utilizes the fusion capabilities of NL-Block to effectively address multi-scale issues in ship detection tasks. In ship detection, the size and shape of ships are influenced by distance and angle, resulting in ships of different scales appearing in the same image. Traditional detection methods cannot effectively handle this multi-scale variation. By combining shallow features (with high spatial resolution) with deep features (with a large receptive field), NL-Block helps the model better capture ship target features at different scales. Shallow features provide detailed and local information, facilitating accurate localization of small-scale ships, while deep features provide global semantic information, aiding in the identification of large-scale ships. Using the NL-Block model enables a more comprehensive understanding of ship targets in images, improving the accuracy and robustness of ship detection at different scales. Attached Figure Description
[0053] Figure 1 This is a flowchart illustrating the implementation of the ship detection method based on the fusion of reconstructed convolution and enhanced features of the present invention.
[0054] Figure 2 This is a schematic diagram of the architecture of the ship detection method based on the fusion of reconstructed convolution and enhanced features of the present invention;
[0055] Figure 3 This is a schematic diagram of the SCConv calculation process;
[0056] Figure 4 This is a schematic diagram of the SRU calculation process;
[0057] Figure 5 This is a schematic diagram of the CRU calculation process;
[0058] Figure 6 This is a schematic diagram of the NL-Block calculation process;
[0059] Figure 7 This is a schematic diagram of the ship detection method based on the fusion of reconstructed convolution and enhanced features in one embodiment of the present invention. Detailed Implementation
[0060] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0061] Example 1
[0062] This invention proposes a ship detection method based on the fusion of reconstructed convolution and enhanced features to achieve better ship detection results and demonstrate superior performance in handling complex scenes and multi-scale ship detection. First, reconstructed convolution is introduced to eliminate spatial and channel redundancy that may arise after convolution operations. Reconstructed convolution effectively reduces the number of parameters and computational cost while maintaining the feature map size, making the model more lightweight. Furthermore, this invention proposes an enhanced feature fusion method called NL-Block. NL-Block utilizes the mechanism of non-local blocks to capture the global dependencies between high-level and shallow features. Through NL-Block, high-level semantic information and low-level feature information can be more fully fused, improving the model's ability to detect ships at multiple scales. Figure 1 As shown, the specific detection process of the ship inspection method proposed in this invention is as follows:
[0063] S1. Use images containing ship targets as input data.
[0064] S2. The input data is processed through a feature extraction backbone network to extract features at three different scales.
[0065] S3. Reconstruct the extracted features using convolution to reduce the redundancy of spatial and channel information, resulting in three feature layers of different sizes.
[0066] S4. Input three feature layers of different sizes into the NL-Block module and perform feature fusion on the high-level semantic information and the low-level feature information to output three feature maps.
[0067] The architecture of this invention based on the fusion method of reconstructed convolution and enhanced features is as follows: Figure 2 As shown.
[0068] S5. The three output feature maps are fed into the detection head of the first-stage detection algorithm for target box prediction and classification.
[0069] 1. This invention uses reconstructed convolution to eliminate spatial and channel redundancy in convolutional neural network models. The Spatial and Channel Reconstruction Convolution (SCConv) module aims to reduce information redundancy between feature maps by optimizing the feature extraction process of convolutional neural networks, thereby compressing the model and improving performance. Its core idea is to retain important spatial information and reduce redundancy between channels through feature separation and reconstruction operations, thereby improving the model's representational ability while reducing model parameters and computational complexity. The calculation process of SCConv is as follows: Figure 3 As shown. The implementation of SCConv includes the following two key steps:
[0070] (1.1) Spatial Reconstruction (SRU): First, a feature separation operation is performed, the purpose of which is to separate the feature map with more information from the feature map with less information. The formula is as follows, where X is the input original feature map:
[0071]
[0072] W = Gate(Sigmoid(W) γ (GN(X))))
[0073] First, the input feature maps are grouped and normalized: X out =GN(X), where γ and β are two training variables. γ represents the spatial information between pixels; a larger value indicates richer spatial information. Normalization alters the distribution characteristics of the input and may lose some valuable information. β, as a learnable offset parameter, can help the network recover the expressive power lost during normalization.
[0074] After normalization, a threshold is set to determine the feature layers. Layers exceeding the threshold are considered to have rich spatial information, while those below are considered to have less spatial information. The above formula separates feature layers with rich spatial information from those with less spatial information. The feature layer with rich spatial information is designated W1, and the feature layer with less spatial information is designated W2.
[0075] Then, a reconstruction operation is performed, which adds features with more information to features with less information to generate features with more information and save space. The calculation process is as follows: the feature layer with rich spatial information is divided into W... 11 W 12 The feature layer with less spatial information is divided into two parts, W. 21 W 22 Two parts, and cross-reconstruction using the following formula:
[0076] W 11 +W 22 =X w1
[0077] W 12 +W 21 =X w2
[0078] X w1 ∪X w2 =X w
[0079] SRU processing yields a spatially refined feature map X. wThis allows for the separation of information-rich features from information-poor features, reducing feature redundancy in spatial dimensions. Consequently, the neural network can better utilize information between different feature maps, improving the model's representational ability and, to some extent, reducing the number of parameters and computational complexity. The SRU calculation process is as follows: Figure 4 As shown.
[0080] (1.2) Channel Reconstruction (CRU): Channel reconstruction also involves performing a split-then-reconstruction operation. First, the hyperparameter α (0≤α≤1) is used to reconstruct X. w It is divided into two parts. One part has αC channels, denoted as the input X for "rich feature extraction". up The other part is (α-1)C, denoted as the supplementary X for "rich feature extraction". low For X up Perform grouped convolution and pointwise convolution separately, and sum the results to obtain Y1. For X... low Perform pointwise convolution to obtain Y2.
[0081] Then, channel fusion is performed. This operation first combines global spatial information and channel statistics using global average pooling, then processes the data using Softmax to obtain feature weight vectors β1 and β2, and finally outputs Y = β1Y1 + β2Y2. Channel reconstruction allows the neural network to utilize feature information more efficiently, further improving the model's representational ability. The CRU calculation process is as follows: Figure 5 As shown.
[0082] 2. Improving the Fusion Degree Between Feature Layers Using Enhanced Feature Fusion Methods In ship detection tasks, fusing features at different scales is crucial. In actual detection, images may contain both large and small ships. If the feature representations of ships at different scales are inconsistent, using fused features for ship detection will reduce detection accuracy. Therefore, for ship detection tasks, it is necessary to consider both local and global information in the image. Shallow features help capture the detailed features and local structure of ships, which is very important for accurately detecting small ships. On the other hand, high-level features can better represent the overall shape and size of the ship. By fusing these two types of features, the model can be more accurate and robust in detecting ships of various scales. To this end, this invention uses the NL-Block (NonLocal-Block) fusion strategy to better fuse shallow and high-level features. The calculation process is as follows: Figure 6 As shown.
[0083] In NL-Block, we combine features containing fine-grained pixel information with features containing a larger receptive field by calculating the global dependency between high-level and shallow features. The specific calculation steps are as follows:
[0084] (2.1) Feature transformation: The high-level feature map (Key and Value) is adjusted to the same size as the low-level feature map (Query) through operations such as convolution or upsampling to ensure that the high-level features and low-level features are aligned in spatial dimensions.
[0085] (2.2) Pull into a one-dimensional vector: Pull the adjusted high-level feature map and low-level feature map into one-dimensional vectors respectively, and retain the feature information of each position in the feature map.
[0086] (2.3) Calculate similarity: Use the similarity between the high-level feature map Key and the low-level feature map Query to measure the degree of association between the low-level features and the high-level features at each location.
[0087] (2.4) Weighted fusion: Based on the similarity weights obtained in step (3), the weighted summation is performed on each position of the high-level feature map to obtain the fused feature representation, thereby realizing the modeling of global dependencies.
[0088] Specific implementation examples:
[0089] In this implementation, YOLOv7 is selected as the backbone network. Based on this network, reconstructed convolutions and enhanced feature fusion methods are used, as shown in the model below. Figure 7 As shown. The experimental data used was the Seaship dataset, which contains 7000 images with different backgrounds and scales. The specific execution process is as follows:
[0090] 1) Use the images in the dataset as input data and input them into the YOLOv7 backbone feature extraction network for feature extraction.
[0091] 2) The extracted features at three scales of 80x80, 40x40, and 20x20 are reconstructed using convolution to eliminate spatial and channel redundancy without changing their scale and number of channels.
[0092] 3) Perform feature fusion on the reconstructed features. The specific fusion process is as follows: the three feature layers are respectively used as shallow features, middle features, and deep features. The shallow features and deep features are enhanced and fused once, and the middle features and deep features are enhanced and fused once. Finally, the three feature maps obtained by fusion are input into the YOLO detection head.
[0093] 4) After receiving three feature layers of different sizes, the YOLO detection head generates candidate boxes. Then, the most suitable target box is selected as the prediction box through the non-maximum suppression algorithm. At the same time, the target box is classified to generate the ground truth box and classification confidence.
[0094] During training, the model of this invention employs the following three loss functions: classification loss L...class Boundary regression loss L local Confidence loss L obj The overall loss function of the model is a weighted sum of the three types of losses mentioned above, and its calculation formula is as follows:
[0095]
[0096] Here, λ is the weight of the regression box loss, used to adjust the model's focus on the regression box loss.
[0097] Classification loss L class The calculation formula is as follows:
[0098]
[0099] Where N represents the total number of categories, x i y is the predicted value for the current category. i This represents the probability of the current category. The true value (0 or 1) for the current category.
[0100] Confidence loss L obj The calculation formula is as follows:
[0101]
[0102] C * =Sigmod(C)
[0103] Where N is the number of samples and γ is the balancing factor, used to balance the impact of positive and negative samples on the loss. It is the confidence level obtained after the predicted value C is processed by the Sigmoid function.
[0104] In calculating the bounding box regression loss L local When using CIOU, its calculation formula is as follows:
[0105]
[0106] Where v is the aspect ratio similarity between the ground truth bounding box and the predicted bounding box, and its calculation formula is as follows:
[0107]
[0108] Where α is a balancing factor used to adjust the weight of width and height similarity when calculating the loss, and IOU is the intersection-union ratio of the target boxes, and the corresponding calculation formula is as follows:
[0109]
[0110] The final regression loss L local The calculation formula is:
[0111]
[0112] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A ship detection method based on the fusion of reconstructed convolution and enhanced features, characterized in that, The method steps include: Acquire images containing ship targets; A feature extraction backbone network was used to extract features from images containing ship targets, resulting in features at three different scales. The extracted features are subjected to spatial and channel reconstruction convolutions to eliminate spatial and channel redundancy, resulting in three feature layers. The spatial and channel reconstruction convolutions perform feature separation and reconstruction operations on the spatial and channel sides respectively to retain important spatial information and reduce redundancy between channels. The specific steps for spatial reconstruction are as follows: Perform grouping and normalization operations on the input feature maps; After normalization, a threshold is set to determine the feature layer, thus identifying the feature layer with rich spatial information. Feature layers with less spatial information Separation; The separated feature layers are reconstructed, and the feature layers with rich spatial information are divided into... , Two parts, dividing the feature layer with less spatial information into , Two parts are used, and the spatially refined feature map is obtained by cross-reconstruction using the following formula. : The specific steps for channel reconstruction are as follows: Using hyperparameters Spatial reconstruction yields detailed spatial feature maps. It is divided into two parts, one part is the number of channels. , as input for rich feature extraction The other part is taken As a supplement to rich feature extraction ; Input for rich feature extraction Perform grouped convolution and pointwise convolution separately, and then add the results. A supplement to rich feature extraction Perform pointwise convolution to obtain ; Channel fusion is performed by combining global spatial information and channel statistics using global average pooling, followed by Softmax processing to obtain the feature weight vector. , Output ; The three feature layers are input into the NL-Block module to fuse high-level semantic information and low-level feature information, and output three feature maps. The feature map is fed into the detection head of the first-stage detection algorithm for target bounding box prediction and classification, thus obtaining the ship detection results.
2. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 1, characterized in that, The feature fusion of high-level semantic information and low-level feature information specifically refers to: The three feature layers serve as shallow features, middle features, and deep features, respectively. The NL-Block module is used to enhance and fuse shallow and deep features, as well as mid-level and deep features, respectively. Finally, three feature maps of the fused features and deep features are output.
3. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 2, characterized in that, The NL-Block module combines features containing fine-grained pixel information with features containing a larger receptive field by calculating the global dependency between high-level and low-level features. The specific steps are as follows: Adjust the high-level feature map to the same size as the low-level feature map to ensure that the high-level features and low-level features are aligned in spatial dimensions; The adjusted high-level feature map and low-level feature map are each stretched into a one-dimensional vector, while retaining the feature information at each position in the feature map; The similarity between high-level feature maps and low-level feature maps is used to measure the degree of correlation between low-level features and high-level features at each location; Based on the similarity weights, a weighted sum is calculated at each location of the high-level feature map to obtain the fused feature representation.
4. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 1, characterized in that, During the training process of the one-stage detection algorithm, the overall loss function of the model adopts classification loss. Border regression loss and confidence loss The weighted sum is calculated using the following formula: in, These are the weights of the regression box loss, used to adjust the model's focus on the regression box loss.
5. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 4, characterized in that, The classification loss The calculation formula is as follows: in, Represents the total number of categories; This is the predicted value for the current category; This represents the probability of the current category. This is the true value for the current category.
6. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 4, characterized in that, The bounding box regression loss use The calculation formula is as follows: in, The aspect ratio similarity between the ground truth bounding box and the predicted bounding box; It is a balancing factor used to adjust the weight of width and height similarity when calculating the loss. It is the intersection-union ratio of the target boxes.
7. The ship detection method based on the fusion of reconstructed convolution and enhanced features according to claim 4, characterized in that, The confidence loss The calculation formula is as follows: in, The number of samples; This is a balancing factor used to balance the impact of positive and negative samples on the loss. It is a predicted value. The confidence level obtained after applying the Sigmod function.
Citation Information
Patent Citations
SAR image ship target detection method based on non-local feature enhancement
CN111563414A
Ship license plate detecting and positioning method, storage medium and electronic equipment
CN116844145A
