A method and system for detecting sea surface ship targets without anchor frame based on key points
Through the anchor-free frame detection method based on key points, a sea surface ship detection data set is constructed and an anchor-free frame ship object detection network model with Backbone-Neck-Head structure is used to solve the problems of traditional manual detection resources and complexity of anchor-frame algorithms, and a simple and efficient multi-category ship detection is achieved.
Patent Information
- Application Number
- CN202310072785.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-02-07
AI Technical Summary
Traditional sea surface ship detection methods rely on manual monitoring, resulting in waste of resources and reduced detection accuracy. The anchor frame-based detection algorithm is difficult to accurately detect ships with variable sizes in complex scenarios and the calculation is cumbersome, and the existing anchor frame-free algorithms lack performance.
Using the anchor-free frame detection method based on key points, by constructing sea surface ship detection data sets, using the anchor-free frame-free ship object detection network model with Backbone-Neck-Head structure, combining the cross-stage local network reconstruction backbone network and adaptive weighted feature fusion strategy, a coordinate alignment compensation module is designed to simplify the detection process and improve detection accuracy.
It realizes simple and efficient ship inspection, which can accurately detect multiple types of ships in complex environments, reduces redundant calculations and post-processing operations, and improves detection performance and stability.
Smart Images

Figure CN116311093B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship target detection, and in particular to a key point-based anchor-free sea surface ship target detection method and system. Background Art
[0002] Traditional surface ship detection tasks often require maritime personnel to conduct long-term manual monitoring, assessing and recording ship activity through real-time monitoring of surface surveillance video. However, in complex and ever-changing real-world scenarios, traditional manual inspection consumes significant human resources. Furthermore, the long-term work makes the inspection task repetitive and tedious, making maritime personnel prone to missed and false detections due to visual fatigue, thus affecting the accuracy of surface ship detection tasks. Applying computer vision target detection technology to ship motion monitoring tasks can achieve automatic detection and tracking of surface ship targets, enabling ocean monitoring systems to issue timely alerts to abnormal ship activity without manual intervention. This is of great significance for achieving intelligent ship detection and efficient maritime area management.
[0003] Thanks to convolutional neural networks' adaptive learning of deep features from real-world data distributions, deep learning-based object detection methods have demonstrated excellent performance on numerous public datasets, gradually replacing traditional detection methods as the preferred approach. Deep learning-based object detection methods can be categorized into two-stage and one-stage approaches, as well as anchor-based and anchor-free methods.
[0004] Currently, a large number of studies targeting ship detection tasks primarily use one-stage detection algorithms based on anchor frames. These algorithms fail to eliminate the need for manual setup of complex anchor frames. However, the ship targets in surface ship detection tasks often have complex and variable sizes, making it difficult to accurately capture all ship targets using a fixed number of anchor frames. Furthermore, the anchor frame setup introduces a large number of targets to be detected during inference, making the detection network computationally more complex and resulting in a large number of redundant prediction box outputs, necessitating time-consuming post-processing operations such as non-maximum suppression. The small amount of ship detection work that uses anchor-free detection algorithms does not utilize keypoint-based setup to eliminate time-consuming post-processing operations, which, to a certain extent, contributes to the algorithm's performance shortcomings. Summary of the Invention
[0005] In response to the above problems, the present invention provides a key point-based anchor-free frame sea surface ship target detection method, system and storage medium. The method aims to complete the sea surface ship detection task by using a key point-based anchor-free frame detection algorithm, thereby eliminating complicated anchor frame settings and time-consuming post-processing operations, and realizing a simple and efficient ship detection network design.
[0006] A first aspect of the present invention provides a method for detecting sea surface ship targets without anchor frames based on key points, the method comprising the following steps:
[0007] Construct a large-scale surface ship detection dataset based on crawler algorithms and the diversity of ship data;
[0008] Constructing a keypoint-based anchor-free frame ship target detection network model, the anchor-free frame ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output; the Head includes a category positioning branch and a coordinate regression branch, the two branches perform different calculations on the same input feature representation, and then integrate the results to obtain a predicted frame output;
[0009] The key point-based anchor-free frame ship target detection network model is trained, and the test data is input into the trained key point-based anchor-free frame ship target detection network model for prediction, and a prediction frame is output.
[0010] A further technical solution of the present invention is: the category positioning branch obtains a heat map with a channel number of C by convolution calculation, wherein C is the number of target categories to be detected contained in the current detection data set, and the category positioning branch obtains a new heat map output by performing maximum pooling on the heat map in the channel dimension, wherein the high probability position on the channel feature map corresponding to each category represents the category prediction and key point position prediction (c, x, y) of the target to be detected, c represents the category prediction, and (x, y) represents the key point position; the coordinate regression branch obtains a coordinate with a channel number of 4 by convolution calculation Prediction features, at the same spatial position of the key point position (x, y), the four coordinate prediction features on different channels of the coordinate prediction features represent the relative distances (l, r, t, b) between the four boundaries of the detection box and the target center key point; after the category positioning branch completes the detection of the target key point (c, x, y), the coordinate regression result (l, r, t, b) at the current position is obtained by one-to-one corresponding the target key point on the coordinate regression branch, and the overall detection is completed by determining the prediction result (c, x, y, l, r, t, b) of each target to be detected.
[0011] A further technical solution of the present invention is: the Backbone is a CSP-Darknet backbone network obtained by reconstructing Darknet-53 using a cross-stage local network CSPNet.
[0012] A further technical solution of the present invention is: a fast spatial pyramid pooling SPPF module is set at the end of the CSP-Darknet backbone network structure to further improve the receptive field size of the CSP-Darknet backbone network.
[0013] A further technical solution of the present invention is: using a cross-stage local network CSPNet to reconstruct the Bottleneck module in the Darknet-53 to obtain CSP-Bottleneck. In the CSP-Bottleneck structure, a 1×1 convolution transformation is first used to divide the input features in half to obtain two features. The two features are processed differently, one uses the original Bottleneck module to complete the feature extraction calculation, and the other is directly passed backward to complete the splicing operation with the output features of the Bottleneck module to obtain the final output features. While obtaining richer gradient combinations, richer underlying detail texture features are retained and the amount of calculation is reduced.
[0014] A further technical solution of the present invention is that: Neck uses an adaptive weighted feature fusion strategy to weightedly fuse features of different scales in each layer of the feature pyramid to obtain a feature representation of adaptive distribution of high-level abstract semantic information and low-level detailed texture information. The adaptive weighted feature fusion strategy specifically includes:
[0015] For the features of a certain level in the feature pyramid, the features of other levels are adjusted to the same resolution and the same number of channels for integration, and the corresponding convolutional layers are designed for the features of each level to calculate the adaptive weighting weights;
[0016] The convolutional layer that calculates weights is continuously optimized through network training learning methods, so that the convolutional layer can accurately obtain the optimal weight corresponding to each feature in the forward reasoning phase of the network;
[0017] At each spatial position, if the feature carries information that contradicts the accuracy of the detection, the adaptive weight of the feature will be reduced. If the feature carries more discriminative clues at the spatial position, the adaptive weight of the feature will be enhanced.
[0018] A further technical solution of the present invention is: the Head uses a coordinate alignment compensation structure CAC to set an interactive connection to transfer the feature information in the category positioning branch to the coordinate regression branch, so as to ensure that the spatial positions of the optimal prediction centers on the two branches are aligned; wherein, the coordinate alignment compensation structure CAC includes a coordinate compensation branch structure and a training guidance module based on weight distribution, the coordinate compensation branch is used to compensate and correct the coordinates given by the current coordinate prediction result, the coordinate compensation branch is set in parallel with the category positioning branch and the coordinate regression branch, and the input feature of the coordinate compensation branch is the feature representation output by the Neck and the coordinate The feature representation output by the regression branch is the spliced feature, and the coordinate compensation branch performs convolution calculation on the input feature to obtain the feature output; the training guidance module based on weight distribution obtains the feature map output by convolution calculation for the heat map of the category positioning branch, and each position of the feature map is a probability value in the numerical interval [0,1], and the probability value represents the probability of occurrence of the center of the target to be detected at each position. The training guidance module based on weight distribution uses a two-dimensional Gaussian kernel function to perform Gaussian distribution normalization on the high-probability position and its surrounding area in the feature map, so as to perform coordinate correction optimization on the center position of the high-probability area during the training process.
[0019] A second aspect of the present invention is a key point-based anchor-free sea surface ship target detection system, comprising:
[0020] Construct a sea surface ship detection dataset unit, which is used to construct a large-scale sea surface ship detection dataset based on the crawler algorithm and the diversity of ship data;
[0021] Constructing an anchor-free ship target detection network model unit, which is used to construct a key point-based anchor-free ship target detection network model. The anchor-free ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output. The Head includes a category positioning branch and a coordinate regression branch. The two branches perform different calculations on the same input feature representation and then integrate the results to obtain a prediction frame output;
[0022] A network model training unit, used for training the key point-based anchor-free ship target detection network model;
[0023] The prediction unit is used to input the test data into the trained key point-based anchor-free frame ship target detection network model for prediction and output a predicted frame.
[0024] The third aspect of the present invention provides a key point-based anchor-free frame sea surface ship target detection system, comprising: a processor; and a memory, wherein the memory stores a computer executable program, and when the computer executable program is executed by the processor, the above-mentioned key point-based anchor-free frame sea surface ship target detection method is executed.
[0025] A fourth aspect of the present invention is a storage medium having a program stored thereon, which, when executed by a processor, enables the processor to execute the above-mentioned key point-based anchor-free sea surface ship target detection method.
[0026] The present invention provides a method, system and storage medium for detecting sea surface ship targets without anchor frames based on key points. The method crawls images from relevant ship observation websites through a crawler algorithm, screens and organizes them under the consideration of diversity, and finally completes the construction of a ship detection dataset under precise manual annotation, thereby solving the previously mentioned problem of uneven quality of current public ship datasets. For difficult targets such as small and medium-sized ships in visible light images and ships obscured by waves, which focus on underlying detailed texture information, the method of the present invention chooses to achieve richer gradient combinations by reconstructing the backbone network, retaining richer underlying detailed texture features and reducing the amount of calculation. At the same time, a more comprehensive and balanced feature representation is obtained by designing an adaptive weighted feature fusion strategy to achieve algorithm optimization. In addition, for the problem of misalignment of the optimal prediction centers between parallel branches in the decoupled detection head structure, the method of the present invention chooses to alleviate the problem to a certain extent through the design of a coordinate alignment compensation module, so that the detection network can give a more accurate and reliable detection frame prediction, thereby further improving the overall accuracy of the ship detection algorithm. In summary, the beneficial effects of the present invention are as follows:
[0027] (1) The key point-based anchor-free sea surface ship target detection method provided by the present invention can omit the setting of the anchor mechanism in the overall design, so that the detection process does not need to perform a large amount of redundant calculations on numerous candidate areas; in addition, after omitting the anchor mechanism, the redundant predictions contained in the detection output are greatly reduced, and post-processing operations such as non-maximum suppression can be further omitted, making the overall structure more concise. Therefore, the ship detection method disclosed by the present invention has the characteristics of simplicity and efficiency;
[0028] (2) Through the design of a crawler algorithm and careful consideration of the diversity of sea-surface ship images, this paper is able to construct a large-scale, multi-category ship detection dataset. The proposed ship dataset can further fully train the ship detection algorithm, making it well-suited for multi-category ship target detection tasks in complex sea environments.
[0029] (3) The present invention addresses the problem of detecting difficult targets such as small and medium-sized ships and ships obscured by waves in complex environments faced by existing ship detection algorithms. It uses a cross-stage local network to reconstruct the backbone network to achieve richer gradient combinations, while reducing the amount of calculation and retaining rich underlying detailed texture information. It also proposes an adaptive weighted feature fusion method to comprehensively treat high-level abstract semantic information and low-level detailed texture information in different feature representations, thereby obtaining a more comprehensive and balanced feature representation. Through the above design, the ship detection algorithm of the present invention can ensure the stability of detection performance in complex scenarios.
[0030] (4) The present invention addresses the problem of misalignment of optimal prediction centers between branches in the decoupled detection head structure, and proposes a coordinate alignment compensation module to achieve synchronous interaction of information between branches, so that the detection network can adjust the attention of the coordinate regression prediction task to the corresponding spatial position with the help of the coordinate compensation branch, thereby obtaining more accurate and reliable coordinate prediction results, ensuring the accuracy of the algorithm and its superiority compared with other ship detection algorithms. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of a method for detecting sea surface ship targets without anchor frames based on key points in the first embodiment of the present invention;
[0032] Figure 2 This is a schematic diagram of the process of constructing a sea surface ship detection dataset in the first embodiment of the present invention;
[0033] Figure 3 1 is a schematic diagram of the overall structure of the anchor-free sea surface ship detection method based on key points in the first embodiment of the present invention;
[0034] Figure 4 Schematic diagram of the principle of the cross-stage local network in the first embodiment of the present invention;
[0035] Figure 5 Schematic diagram of the reconstruction implementation of the network structure CSP-Bottleneck in the first embodiment of the present invention;
[0036] Figure 6 Schematic diagram of the network structure of CSP-Darknet in the first embodiment of the present invention;
[0037] Figure 7 Schematic diagram of the network structure of the feature pyramid FPN in the first embodiment of the present invention;
[0038] Figure 8 1 is a schematic diagram of a specific structure corresponding to the adaptive weighted feature fusion strategy AWFF in the first embodiment of the present invention;
[0039] Figure 9Schematic diagram of the problem of misalignment of optimal prediction centers between two branches in the decoupled detection head structure in the first embodiment of the present invention;
[0040] Figure 10 2 is a schematic structural diagram of a coordinate alignment compensation structure CAC in the first embodiment of the present invention;
[0041] Figure 11 Schematic diagram of the structure of the anchor-free sea surface ship detection system based on key points in the second embodiment of the present invention;
[0042] Figure 12 This is an architectural diagram of a computer device in Embodiment 3 of the present invention;
[0043] Figure 13 This is a diagram showing the detection effect of a ship's long tail trace in an embodiment of the present invention;
[0044] Figure 14 This is a diagram showing the detection effect of a small-sized ship target in an embodiment of the present invention;
[0045] Figure 15 1 is a diagram showing the detection effect of mutual occlusion of ships and targets in an embodiment of the present invention;
[0046] Figure 16 1 is a diagram showing the detection effect of ship targets of different sizes according to an embodiment of the present invention;
[0047] Figure 17 1 is a diagram showing the detection effects of ship targets of different sizes in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, rather than all structures.
[0049] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0050] The embodiments of the present invention provide the following embodiments for a method, system, and storage medium for detecting sea surface ship targets without anchor frames based on key points:
[0051] Embodiment 1 of the present invention
[0052] This embodiment is used to illustrate the anchor-free sea surface ship target detection method based on key points. Figure 1 , is a flowchart of the anchor-free sea surface ship target detection method based on key points, which specifically includes the following steps:
[0053] S110, constructing a sea surface ship detection dataset, and constructing a large-scale sea surface ship detection dataset based on the crawler algorithm and the diversity of ship data;
[0054] S120: Construct a key point-based anchor-free frame ship target detection network model, wherein the anchor-free frame ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output, the Head includes a category positioning branch and a coordinate regression branch, and the two branches perform different calculations on the same input feature representation and integrate the results to obtain a prediction frame output;
[0055] S130 , training the key point-based anchor-free frame ship target detection network model, inputting test data into the trained key point-based anchor-free frame ship target detection network model for prediction, and outputting a predicted frame.
[0056] The specific implementation process of constructing the sea surface ship detection dataset can be found in Figure 2 In order to collect as much ship image data as possible for dataset construction, solve the problem of uneven quality of ship datasets, and thus fully train the ship detection algorithm, the embodiment chooses to construct a large-scale surface ship detection dataset based on crawler algorithm design and consideration of the diversity of ship data. In the construction of the dataset, the crawler algorithm is used to download online pictures from ship photography sharing websites as the data source. The ship images recorded on the website have very detailed annotation information, including the time and place of shooting, the specific category of the ship, the International Maritime Organization (IMO) number, the tonnage of the ship, the draft, the year of construction, etc. As one of the most critical information, the ship category can reduce the difficulty of classifying the ship targets in the image and improve the work efficiency of the subsequent data annotation process. Therefore, when designing the crawler program, the obtained pictures are downloaded and saved according to the ship category. See Figure 2As shown, the embodiment chooses to design a multi-threaded crawler algorithm design, sequentially obtains the ship category page address and the ship image detail page address, and then uses multi-threading to realize image downloading. The 200,000 ship images obtained by the crawler download are one of the main reasons for ensuring the diversity of the surface ship detection dataset. Subsequently, how to organize and screen the obtained ship images, remove ship images with high repetitiveness, low image quality, or that do not meet the detection data requirements, and complete the final determination of the self-built dataset is an important issue. In order to ensure the high quality of the self-built ship dataset and its applicability to the surface ship target detection algorithm, it is necessary to consider the richness and diversity in the organization and screening of the ship image data, including the diversity of background changes, the diversity of ship categories, the diversity of target sizes, the diversity of perspective changes, and the diversity of wave changes.
[0057] Diversity of Background Variation: The practical application scenarios of marine vessel detection methods are complex and varied. A dataset of ship images with rich background variations can significantly improve the generalization of deep learning-based object detection algorithms through network training, enabling them to accurately detect objects despite interference from background features in diverse application scenarios. In addition to improving the generalization of the algorithm, image data with diverse background variations can further enhance detection accuracy through the richness of training samples, and even achieve even better performance when using images synthesized with virtual backgrounds. Therefore, when compiling and screening ship images to construct the detection dataset, we selected as many ship images as possible, encompassing a variety of backgrounds, such as inland ports, nearshore terminals, and offshore waters, to enrich the dataset's background diversity. Furthermore, occlusion caused by multiple vessels, a common problem in practical application scenarios such as nearshore terminals and ports, is equally critical. Therefore, while compiling and screening ship images from multiple scenarios, we also collected a large number of multi-target ship images to populate the dataset, further enriching the dataset's background diversity. This increases the dataset's challenge and makes it more suitable for practical application scenarios.
[0058] Diversity of ship categories: In practical marine video surveillance systems, detection algorithms designed only for a single category of ship targets have low application value and are not suitable for the complex maritime environment that is booming and developing today. Therefore, the detection algorithm needs to be able to accurately detect as many different categories of ship targets as possible to maximize its value. To complete the multi-target ship detection task, the most intuitive and effective approach is to enrich the diversity of ship categories as much as possible when constructing the ship detection dataset, and then screen and organize a sufficient number of ship images to fill each category to complete the construction of the detection dataset. After statistically considering the common ship categories in the obtained data sources, the embodiment specifically selects 10 common ship categories in sea scenes and 1 other ship category to construct a ship detection dataset, thereby maximizing the performance of the ship detection algorithm after training. In addition, to ensure the training stability of the deep learning-based detection algorithm when using the ship dataset, the relevant algorithm avoids focusing on different categories of ship targets, resulting in inconsistent detection performance for different ship categories. During the process of organizing and screening ship images, the number of images in each category should be evenly distributed as much as possible, so that the detection algorithm treats all types of ship targets equally during the training process, achieving comprehensive detection stability.
[0059] Diversity in Target Size: In the practical application of marine video surveillance systems, maritime personnel in front of the screen are often required to quickly respond to small and medium-sized vessels as far away as possible so that targeted countermeasures can be implemented early. For surface vessel detection algorithms, this challenge becomes how to improve the algorithm's detection performance for small and medium-sized targets, enabling accurate detection of small and medium-sized vessels as far away as possible, facilitating subsequent work arrangements by maritime personnel. To address this issue, when constructing a ship dataset, images of small-sized vessels should be selected as the dataset components whenever possible. Furthermore, during the corresponding data annotation process, small and medium-sized objects should be accurately labeled as much as possible based on the human eye's ability to discern them. This allows for intuitive dataset preparation during detection network training to further improve the network's detection performance for small and medium-sized vessels, making the ship dataset more challenging and more suitable for specific practical application scenarios.
[0060] Diversity of perspective changes: Surveillance cameras deployed at different locations often capture images of ships from different perspectives. At this point, the detection algorithm should be able to quickly and accurately predict ship targets from different perspectives, thereby achieving the generalization of the ship detection algorithm under different perspectives. Therefore, from the perspective of using datasets to solve this problem in the training phase of the detection algorithm, the diversity of perspective changes should be pursued during the preparation of the dataset, including the overhead perspective of surveillance cameras, the horizontal perspective of ship-borne cameras, the upward perspective of photographers around the island coast, and the different perspectives of ships under the ups and downs of waves, etc., so that the ship dataset is better adapted to general situations and ensures that the detection algorithm can achieve better detection performance after training with this dataset. In addition, when screening and organizing ship images, the existing preliminary dataset is filtered to ensure a balanced number of ship images from different perspectives.
[0061] The diversity of ocean wave changes: In the actual ocean scene with surging waves, the complex and unpredictable ocean wave changes are one of the main problems affecting the detection performance of the surface ship detection algorithm. When the sea area where the ship target is located experiences drastic ocean wave changes due to severe weather conditions, the ship target will show drastic perspective changes under the undulating waves and the large waves will obscure part of the ship's hull features. This makes it impossible for the deep learning-based ship detection algorithm to successfully complete accurate detection based on the conventional image features previously learned. The above problem mainly includes two parts. The consideration of the diversity of perspective changes has to some extent alleviated the difficulty of detecting the perspective changes of ship targets under the undulating waves; and in order to address the problem caused by the occlusion of the waves, we also choose to introduce difficult samples in the ocean wave scene from the data aspect. Through training, we help the convolutional neural network learn the wave features and their corresponding occlusion features, thereby improving the detection performance of the ship detection algorithm for such difficult samples. Therefore, the embodiment obtains more than 3,000 images of ships in ocean wave scenes through image retrieval and collection, and fills them into the corresponding ship categories in the ship dataset to improve the diversity of ocean wave changes in the dataset. This ensures that the surface ship detection algorithm based on deep learning can better adapt to large wave scenes after using this dataset for network training.
[0062] During implementation, a crawler algorithm was used to download ship images from ship photography sharing websites as the data source for constructing the ship dataset. After screening and sorting the downloaded images based on requirements such as background diversity, ship type diversity, object size diversity, viewpoint diversity, and wave diversity, a total of 26,907 ship images meeting the requirements were obtained, covering 11 common ship types in ocean scenarios. The image annotation tool Labeling was then used to accurately annotate the ship objects in the dataset images with detection boxes. The annotation process used human visual observation as the standard. While re-confirming and revising the categories of all ship objects to be annotated, efforts were made to accurately annotate small and medium-sized ship objects that are discernible to the human eye, ensuring that all ship objects predicted by the detection network had corresponding annotation information. After the entire annotation process was completed, statistics generated by the automated script indicated that the ship detection dataset contained 44,708 ship objects to be detected.
[0063] Furthermore, a keypoint-based anchor-free ship target detection network model is constructed, see Figure 3 In this embodiment, a key point-based anchor-free ship detection algorithm is constructed to complete the sea surface ship detection task, thereby eliminating the complicated setting of the anchor frame, making the detection network have a simpler structural design, and being able to omit the post-processing operation in the detection process, making the overall detection process of the algorithm more efficient. Figure 3As shown in the figure, the overall structure of the keypoint-based anchor-free ship target detection network model conforms to the Backbone-Neck-Head architecture of current target detection networks. After the image to be detected is input into the detection network, the backbone network (Backbone) first extracts features from the image to obtain its corresponding deep features. It is worth noting that the deep features obtained after multiple convolutions often have a small image size and are not well suited for the final detection calculation. Secondly, the network's Neck structure organizes and fuses the multi-scale features of the image through a designed feature pyramid, while also restoring the deep features to a larger image size to facilitate subsequent accurate detection. In fact, the Backbone and Neck components of the detection network are equivalent to a pair of "encoders" and "decoders." They implement the encoding and decoding calculations between the input RGB image and the deep feature map, obtaining deep features suitable for the detection head (Head) to calculate the detection box output. How to define this pair of "encoder-decoder structures" is one of the key issues in achieving accurate detection. Finally, the detection head structure of the network contains two different and decoupled branch structure designs, namely the category localization branch (Localization) and the coordinate regression branch (Regression). The two branches perform different calculations on the same input features and finally integrate the results to obtain the predicted box output. The category localization branch obtains a heat map Heatmap with a channel number of C through convolution calculation (C is the number of target categories to be detected contained in the current detection data set), which represents the probability of the central key points of targets of different categories appearing on the image. A new heat map output is obtained by performing a maximum pooling (MaxPooling) operation on the heat map in the channel dimension. Its high probability position on the channel feature map corresponding to each category represents the category prediction and key point position prediction (c, x, y) of the target to be detected; the coordinate regression branch obtains through convolution calculation. The coordinate prediction features with 4 channels are located at the same spatial position of the key point (x, y). The 4 prediction values on different channels represent the relative distances (l, r, t, b) between the 4 boundaries of the detection box and the target center key point. Therefore, after completing the detection of the target key point (c, x, y) on the category localization branch, the regression prediction results (l, r, t, b) at the current position can be obtained one by one on the coordinate regression branch. The overall detection is completed by determining the prediction results (c, x, y, l, r, t, b) of each target to be detected.
[0064] Preferably, the Backbone is a CSP-Darknet backbone network obtained by reconstructing Darknet-53 using a cross-stage local network CSPNet;
[0065] Preferably, a fast spatial pyramid pooling SPPF module is set at the end of the CSP-Darknet backbone network structure to further improve the receptive field size of the CSP-Darknet backbone network.
[0066] Preferably, the Bottleneck module in the Darknet-53 is reconstructed using a cross-stage local network CSPNet to obtain CSP-Bottleneck. In the CSP-Bottleneck structure, a 1×1 convolution transformation is first used to divide the input features in half to obtain two features. The two features are processed differently. One uses the original Bottleneck module to complete the feature extraction calculation, and the other is directly passed backward to complete the splicing operation with the output features of the Bottleneck module to obtain the final output features. While obtaining richer gradient combinations, richer underlying detail texture features are retained and the amount of calculation is reduced.
[0067] In practice, with the rapid development of deep learning technology, convolutional neural networks have achieved incredibly outstanding performance across various tasks within the field of computer vision. However, as the performance of convolutional neural networks has become increasingly powerful, their specific structures have also become deeper and wider. While deeper and wider network structures generally enable further exploration of high-level semantic features in images, resulting in better detection performance, the overall computational complexity of the network has also increased significantly as the structure has become wider and deeper. This has led to problems such as difficulty in training the network and reduced real-time performance, making the proposed deep learning methods unsuitable for practical application on many low-computing devices.
[0068] The Cross-Stage Partial Network (CSPNet) aims to solve a large number of inference computational problems while maintaining network accuracy and achieving lightweight computing from the perspective of a convolutional neural network architecture. Its basic principle can be succinctly summarized as "achieving richer gradient combinations while reducing computational effort."
[0069] See also Figure 4, showing the specific implementation method of "reducing the amount of computation" in the cross-stage local network. It divides the input features of some convolution modules in the convolutional neural network into two sub-parts in the channel dimension. One part (Part2) participates in the calculation of the pre-designed convolution module (as shown in the Example module in the figure) for feature extraction, and implements feature mapping in the high-level semantic feature space to obtain the corresponding output features; the other part (Part1) does not participate in the feature calculation of the convolution module, but is directly passed backward to perform feature splicing (Concat) operation with the output features of the former in the channel dimension, and is reintegrated into a new deep feature, and finally completes the scale transformation (Transition) operation required by the next convolution module. Among them, the specific network structure corresponding to Part2 is also called a cross-stage hierarchical structure, which is why the cross-stage local network is named.
[0070] Through the aforementioned transformation of the convolutional network structure, the cross-stage local network achieves "richer gradient combinations" while reducing computational effort. It can be clearly seen that, under the cross-stage hierarchical design, the convolutional module is transformed from a single-branch linear structure to a complex dual-branch structure, and the gradient propagation path is also transformed from a single channel to a dual channel. This module thus splits the gradient flow, allowing the gradients of the convolutional network to be backpropagated through different paths. Previously, the convolutional module with a single-branch linear structure was updated and learned based on a single gradient. Due to the chain rule in the gradient backpropagation process, shallow convolutional layers would reuse gradient information, causing the convolutional layers in the module to repeatedly learn the same gradient information. However, after reconstructing the dual-branch complex structure, through the partitioning of the input features and the design of the cross-stage hierarchical structure, the two features use their own corresponding paths for gradient backpropagation. These paths do not contain duplicate gradient information from each other, resulting in greater correlation differences and richer gradient combinations. This allows the convolutional network to more easily learn the target features, thereby achieving a better feature representation. In addition, through the design of a cross-stage hierarchical structure, richer underlying detailed texture features are retained in the convolution module. Figure 4 As shown in Figure 1, the corresponding part of Part 1 passes the underlying detail features backward without any processing, so that the detection network can adaptively select the required feature information for utilization through training and learning, ensuring that the feature representation obtained by the backbone network is more comprehensive.
[0071] During the specific implementation process, in the Backbone part, for the backbone network Darknet-53 used in detection network algorithms such as TTFNet and YOLO, based on the consideration of obtaining richer gradient combinations in the feature extraction link and reducing the network calculation amount at the same time, Darknet-53 was reconstructed with reference to the cross-stage local network CSPNet to obtain a more powerful and efficient CSP-Darknet, thereby obtaining better feature representation to improve the network's detection performance, especially for difficult targets such as small and medium-sized ships, ships obscured by waves, etc., which focus on the underlying detailed texture features.
[0072] For the most important Bottleneck module in Darknet-53, we use a cross-stage hierarchical structure to reconstruct CSP-Bottleneck to "achieve richer gradient combinations while reducing the amount of computation." The specific reconstruction transformation is as follows: Figure 5 As shown in the figure, to further reduce computational complexity, the activation function of the standard convolution module is replaced with ReLU, replacing the previous Leaky ReLU setting. In the CSP-Bottleneck structure, a 1×1 convolution transform is first used to split the input features in half. The two features obtained by the feature split are then processed differently: one uses the original Bottleneck structure to complete feature extraction calculations, while the other is directly passed backward to complete the splicing operation with the output features of the Bottleneck structure to obtain the final output features. This not only reduces the overall computational complexity and memory usage of the module and implements a rich gradient combination to accelerate the convergence of the detection network, but also during the image feature transmission process, the detailed texture features from the underlying layer are not fully used for feature extraction, but are partially retained. The output features obtained by feature splicing contain richer image detail information, which helps alleviate the detection network's difficulty in detecting small and medium-sized objects and occluded objects.
[0073] Unlike CSPNet, which directly divides the input features in the channel dimension, this embodiment chooses to set 1×1 convolution layers to perform channel transformation on the input features, thereby halving the number of channels of the features. Compared with direct division, this design can improve the reusability of features with a small amount of computational cost. The reason is that direct division of the input features in the channel dimension means that both branches can only use half of the features, and cannot fully utilize the complete features, which may cause the loss of some important feature information applicable to the current branch. Using 1×1 convolution instead of direct division to achieve feature dimensionality reduction allows both branches to use the complete feature information and adaptively select the feature information during training, thereby obtaining a better feature representation and achieving more accurate detection performance.
[0074] After completing the reconstruction of the CSP-Bottleneck module, the CSP-Darknet backbone network was built with reference to the previous Darknet-53 network structure. Its specific structure is as follows Figure 6 In addition, CSP-Darknet also sets up a fast spatial pyramid pooling SPPF (Spatial Pyramid Pooling-Fast) module at the end of the backbone network structure to further improve the network's feature extraction capabilities to cooperate with other subsequent modules of the detection network.
[0075] The original spatial pyramid pooling (SPP) obtains high-level semantic features of different receptive fields by setting up three parallel maximum pooling layers with pooling kernel sizes of 5×5, 9×9, and 13×13. By performing feature concatenation and convolution on these features, the expressive power of the obtained features is enriched, resulting in a feature representation with a large receptive field and rich multi-scale information. Figure 6 As shown in , SPPF replaces the parallel structure in SPP by serially setting three maximum pooling layers with a kernel size of 5×5. According to the basic superposition property of convolution, the computational receptive fields of the two are consistent. Experiments have shown that the computational speed of the serial structure is about twice that of the parallel structure design SPP.
[0076] In summary, in the backbone network part of the ship detection network, the embodiment of the present invention refers to the cross-stage local network reconstruction Darknet-53 and uses the more powerful and efficient CSP-Darknet to complete the feature extraction of the input image. While reducing the computational complexity and memory usage of the detection algorithm, it enriches the underlying detail texture information in the gradient change combination and deep features to obtain a better feature representation. After completing the calculation of CSP-Darknet, combined with Figure 2 The C2, C4, C6, and C9 output features in the detection network are passed back to the Neck part of the detection network to complete the size recovery of the deep feature map and the fusion of multi-scale information.
[0077] Preferably, the Neck method uses an adaptive weighted feature fusion strategy to perform weighted fusion on features of different scales in each layer of the feature pyramid to obtain a feature representation of adaptive distribution of high-level abstract semantic information and low-level detailed texture information. The adaptive weighted feature fusion strategy specifically includes:
[0078] For the features of a certain level in the feature pyramid, the features of other levels are adjusted to the same resolution and the same number of channels for integration, and the corresponding convolutional layers are designed for the features of each level to calculate the adaptive weighting weights;
[0079] The convolutional layer that calculates weights is continuously optimized through network training learning methods, so that the convolutional layer can accurately obtain the optimal weight corresponding to each feature in the forward reasoning phase of the network;
[0080] At each spatial position, if the feature carries information that contradicts the accuracy of the detection, the adaptive weight of the feature will be reduced. If the feature carries more discriminative clues at the spatial position, the adaptive weight of the feature will be enhanced.
[0081] During implementation, accurate detection of difficult targets, such as small and medium-sized vessels and those obscured by waves, is a key challenge facing surface vessel detection methods. To improve detection performance for these difficult targets, this example describes a surface vessel detection dataset that considers data diversity, addressing this issue through training the detection network based on the most intuitive data. Furthermore, designing a subsequent detection head structure that achieves a more comprehensive and balanced feature representation for these difficult targets, focusing on underlying texture information, is also an effective approach.
[0082] Feature representation is the information representation that convolutional neural networks create based on the input image. Generally speaking, after the backbone network extracts features from the input image, the resulting feature representation is often small-resolution features that contain rich, high-level, abstract semantic information. However, the underlying detailed texture information of the image is constantly obscured and ignored by the layers of convolution. However, both high-level, abstract semantic features and underlying, detailed texture features are extremely important for object detection tasks. Therefore, how to comprehensively consider the multi-scale features of the image has become a key issue in improving network detection performance.
[0083] See also Figure 7, showing the specific structure of the feature pyramid. It restores the resolution of the feature map from top to bottom and adjusts the high-level semantic information and low-level detailed texture information in the feature map layer by layer through upsampling (nearest neighbor interpolation method) operations, 1×1 convolution layers, and feature addition operations. The role of the 1×1 convolution transformation is to perform channel transformation on the intermediate features extracted by the backbone network to facilitate feature addition with the upsampled features. The feature representation of each layer in the feature pyramid (except the highest layer) includes two sources of information: one is the upsampling result of the high-level features, which contains rich abstract semantic information; the other is the feature extraction result of the corresponding resolution size in the backbone network, which contains rich detailed texture information. Therefore, the feature representation obtained by feature addition in each layer of the feature pyramid contains more comprehensive information than the feature representation of the corresponding resolution in the backbone network. However, the only drawback is that the top-down progressive structure means that the feature representation of each layer can only filter and utilize the feature information of different scales in the features of the previous layer, but cannot coordinate and take into account the multi-scale information in different layers, so that the output features still cannot achieve the best representation.
[0084] It should be noted that this type of keypoint-based anchor-free detection network is designed as a single-scale structure, that is, only the last layer of features in the feature pyramid is used to pass backward to complete the detection output, so that the detection network can achieve fast and lightweight performance. The reason for this design is that the target position on the underlying features with larger resolution is more accurate, and the central key points and boundary positions of large and small targets can basically obtain stable prediction outputs, which is less restricted by multi-scale problems than the anchor-based detection method. However, the design of the single-scale structure also makes the feature representation passed backward for prediction calculation by the detection head structure more critical, and the consideration of multi-scale information in different convolutional layers has become an important issue in improving the performance of the detection network.
[0085] Therefore, the embodiment of the present invention proposes the following in the sea surface ship target detection network: Figure 8 The adaptive weighted feature fusion strategy AWFF shown in the paper can comprehensively consider and weightedly fuse features of different scales in each layer of the feature pyramid, obtain feature representations of adaptive distribution of high-level abstract semantic information and low-level detailed texture information, and thus achieve accurate detection of difficult targets such as small and medium-sized ships and ships obscured by large waves.
[0086] The adaptive weighted feature fusion strategy learns how to spatially filter feature representations at different levels of the feature pyramid, filtering out spatially conflicting information across different features and suppressing inconsistencies. Finally, by weighted fusion of different features, more valuable information is retained at the same location, resulting in a more comprehensive and balanced output feature representation. In the design and implementation of the AWFF architecture, for features at a particular level in the feature pyramid, features at other levels are first adjusted to the same resolution and number of channels for simple integration. Corresponding convolutional layers are designed for each level and their adaptive weights are calculated. The convolutional layers are then trained and continuously optimized to accurately determine the optimal weights for each feature during the network's forward inference phase. At each spatial location, if features carry information that contradicts detection accuracy, their adaptive weights are reduced, filtering out this information. Conversely, if features carry more discriminative cues at that location, these features are enhanced.
[0087] In the design of the ship detection network, the overall structure of AWFF is set after the feature pyramid. After the [C2, C4, C6, C9] features extracted from the backbone network CSP-Darknet are sequentially obtained from the top to the bottom of the feature pyramid structure to obtain the output features of [P1, P2, P3, P4]. These features are first adjusted by the nearest neighbor interpolation upsampling operation to obtain a feature representation with a unified image resolution of size = 128 × 128 and a number of channels C = 16. Subsequently, the above four image features will be concatenated to obtain an overall feature with a number of channels C = 64. This feature is calculated through the "1 × 1 convolutional softmax layer" structure to obtain a weighted feature with a resolution of size = 128 × 128 and a number of channels C = 4. The values at each position of the feature map corresponding to each channel are all in the interval [0, 1], and the sum of the four weight values of the different weighted features at the same position is 1. It is this learned adaptive weight that indicates the different importance of [P1, P2, P3, P4] at the same spatial position, which enables the output features obtained after feature fusion to adjust the focus on high-level semantic information and low-level texture information at different positions. The specific mathematical expression is shown in the following formula:
[0088]
[0089] In formula (1), i, j represent the same spatial position (i, j) on each feature with resolution size = 128 × 128; Y ij Represents the adaptive weighted output of AWFF for the features of each layer of FPN; Represents the feature representation of FPN output features [P1, P2, P3, P4] with uniform size and number of channels after 1×1 convolution and upsampling transformation; * ij Indicates different features in AWFF The learned weight features.
[0090] The gradient changes of the detection network during the back propagation process can be used to explain the effectiveness of the adaptive weighted feature fusion strategy AWFF. During the back propagation process, the chain derivative of the loss function relative to the feature is shown as follows:
[0091]
[0092] In formula (2), Represents one of the output features [P1, P2, P3, P4] corresponding to each layer of FPN. and In fact, they correspond to the element-by-element feature fusion operation in the AWFF structure and the upsampling operation in the feature pyramid structure. From the simple mathematical derivation of the feature fusion operation, we can know that its gradient value is a constant of 1, and the partial derivative corresponding to the upsampling operation using the nearest neighbor interpolation method is also approximately equal to a constant of 1, which corresponds to the following conditions:
[0093]
[0094]
[0095] By simplifying the gradient calculation in formula (2) using the above formulas (3) and (4), we can get the loss function for the output feature Y ij The overall gradient calculation is as follows:
[0096]
[0097] In the above formula, the loss function is for the output feature Y ij The overall gradient calculation process of the output feature Y ij The gradient at each spatial position is determined by the features of different levels and scales in the feature pyramid [P1, P2, P3, P4]. If the weight α is not set ij ,β ij ,γ ij ,δ ij, the resulting feature representation treats multi-scale information from each layer equally at each spatial location. Optimizing convolution kernel parameters solely through gradient changes fails to filter and optimize information at each location. However, by setting learnable weights for each layer's feature representation, the network can adaptively optimize these parameters based on changes in the loss function during training, ensuring that the features contain rich information from different categories, resulting in a more comprehensive and balanced feature representation.
[0098] In summary, the embodiment of the present invention proposes an adaptive weighted fusion strategy AWFF in the Neck part of the ship detection network, which is used to weightedly fuse multi-scale information in each layer of the feature pyramid. AWFF can adaptively change the weight parameters in feature fusion according to gradient changes, comprehensively treat high-level abstract semantic information and low-level detailed texture information in different feature representations, and provide a more comprehensive and balanced feature representation for the subsequent detection head part in the network structure, thereby alleviating the detection defects of difficult targets such as small and medium-sized ships and ships obscured by large waves, and further improving the overall detection performance of the algorithm.
[0099] Preferably, the Head uses a coordinate alignment compensation structure CAC to set an interactive connection to transfer the feature information in the category positioning branch to the coordinate regression branch, so as to ensure that the spatial positions of the optimal prediction centers on the two branches are aligned; wherein, the coordinate alignment compensation structure CAC includes a coordinate compensation branch structure and a training guidance module based on weight distribution, the coordinate compensation branch is used to compensate and correct the coordinates given by the current coordinate prediction result, the coordinate compensation branch is set in parallel with the category positioning branch and the coordinate regression branch, and the input feature of the coordinate compensation branch is the feature representation output by the Neck and the coordinate regression branch. The output feature representation is the feature after splicing, and the coordinate compensation branch performs convolution calculation on the input feature to obtain the feature output; the training guidance module based on weight distribution obtains the feature map output by convolution calculation for the heat map of the category positioning branch, and each position of the feature map is a probability value in the numerical interval [0,1], and the probability value represents the probability of occurrence of the center of the target to be detected at each position. The training guidance module based on weight distribution uses a two-dimensional Gaussian kernel function to perform Gaussian distribution normalization on the high-probability position and its surrounding area in the feature map, so as to perform coordinate correction optimization on the center position of the high-probability area during the training process.
[0100] In the specific implementation process, the detection head structure is the last link in the standard structure "Backbone-Neck-Head" of the target detection network, in which the prediction of the category center (c, x, y) and the prediction of the detection box boundary coordinates (l, r, t, b) are the final determination of the target to be detected. As mentioned above, the detection head structure often contains two branch structures: the category localization branch (Localization) and the coordinate regression branch (Regression), which correspond to the two subtasks of target classification and detection box regression respectively. For the key point-based anchor-free box detection method, due to the higher resolution of the feature representation used in the single-scale structure and the richer underlying detail texture information in the improved feature representation, the category localization branch can more easily select reliable feature points on the target to be detected to complete the category confirmation and center positioning of the target to be detected; however, the coordinate regression branch is often limited by problems such as the misalignment of the optimal prediction center in the decoupled form, making it impossible for the detection network to obtain the most accurate and reliable coordinate prediction results.
[0101] The decoupled detection head structure ensures that the two parallel branches never interact synchronously during either the training or inference phases of the detection network. During training, the category localization branch and the coordinate regression branch learn the center position (c, x, y) and four bounding box distances (l, r, t, b) of the annotated box, respectively, resulting in a gradual emergence of specificity between the two branches. During inference, the two branches process the input feature representations differently, predicting the center position (c, x, y) and four bounding box distances (l, r, t, b) of the detection box, respectively. This reflects the specificity of the previous training. As a result, for the same target object, the optimal predicted position of the category localization branch and the optimal predicted position of the coordinate regression branch are not aligned or overlapped, resulting in performance defects in the detection network.
[0102] Figure 9 An example of the problem of misalignment of the optimal prediction center between the two branches in the decoupled detection head structure in the detection network is given in the article. The input image contains a fishing boat target. After the image to be detected with a size of W×H is input into the detection network, it is passed through the "Backbone-Neck" pre-structure to obtain the feature representation for the detection head calculation. Subsequently, the resolution size and number of channels of W / 4×H / 4×C and W / 4×H / 4×4 features are obtained through the category positioning branch and the coordinate regression branch respectively. After processing the obtained features using the Softmax layer on the category positioning branch, the center position predicted by the network for the ship target can be determined based on the obtained maximum classification probability Cls:0.89, that is, Figure 9The dot position in the middle and upper part is then output as the labeled detection box according to the corresponding coordinate regression result at this spatial position. However, the intersection-over-union (IoU) of the detection box and the true labeled GT is only IoU:0.53, indicating that the detection box output cannot give an accurate coordinate prediction. If we do the opposite, first calculate the intersection-over-union (IoU) of the coordinate prediction results obtained by the coordinate regression branch at each spatial position and the labeled box one by one, then we can determine that the coordinate prediction with the maximum intersection-over-union (IoU):0.91 comes from the point position at the bottom of the figure. However, the classification probability at the corresponding spatial position is only Cls:0.59, and the prediction result is determined to be Figure 9 The detection box outputs marked in . Clearly, the detection box outputs with Cls:0.89, IoU:0.53 and Cls:0.59, IoU:0.91 come from two different spatial locations, reflecting optimal category localization and optimal coordinate prediction, respectively. This problem is caused by the misalignment of the optimal prediction centers between the two different branches of the decoupled detection head structure.
[0103] In a decoupled detection head structure, whether selecting either the category localization branch or the coordinate regression branch as the judgment criterion, neither can resolve the misalignment of the optimal prediction centers between the two branches, nor can it guarantee the reliability of the detection network's final prediction output. Therefore, an embodiment of the present invention proposes a coordinate alignment compensation structure (CAC) in a ship detection network. By setting up an interactive connection, feature information from the category prediction branch is transferred to the coordinate regression branch. This allows the two branches to be uniformly optimized and their specificity reduced during the training and testing phases, ensuring the spatial alignment of the optimal prediction centers on the two branches, thereby improving the overall performance of the detection network.
[0104] See also Figure 10, showing the overall structure of the coordinate compensation module, which includes a coordinate compensation branch structure and a training guidance module (Weight-Train) based on weight distribution. Among them, the coordinate compensation branch is a branch structure set up in parallel with the category positioning branch and the coordinate regression branch. The input feature of this branch is the result of concatenating the feature representation of the size W / 4×H / 4×128 output by the previous Neck part and the size W / 4×H / 4×4 in the coordinate regression branch, with a size of W / 4×H / 4×132(128+4). After calculating this feature through convolution, a feature output of size W / 4×H / 4×4 is obtained, which is intuitively represented as the coordinate compensation correction given by the coordinate compensation branch to the current coordinate prediction result. Therefore, under the design of the coordinate compensation branch, the detection network can further predict the difference (Δl, Δr, Δt, Δb) between the current detection box and the true bounding box of the target to be detected based on the coordinate prediction results (l, r, t, b) at each position, and finally obtain a more accurate and reliable coordinate prediction result (l+Δl,r+Δr,t+Δt,b+Δb) through feature addition operation.
[0105] However, with only the coordinate compensation branch, category localization and coordinate prediction remain decoupled, lacking information exchange and connection, and still unable to resolve the problem of optimal center position misalignment between the two branches. Therefore, how to achieve structural coupling and avoid specific differentiation between branches by designing information transfer connections and weight-train modules in the CAC structure becomes a key issue.
[0106] The W / 4×H / 4×C heatmap feature in the category localization branch is processed using a "Max Pooling-Softmax" convolutional structure to produce a W / 4×H / 4×1 feature output. Each position in this feature map represents a probability value in the range [0,1], representing the probability of the center of the target being detected at that location. To ensure consistency in the sample selection region during training, a two-dimensional Gaussian kernel function is then applied to this feature, normalizing the high-probability location and its surrounding area with a Gaussian distribution. This allows the detection network to optimize the center position of the high-probability region during training. Since the number of channels in this feature is only C=1, this indicates that the feature has omitted category information after channel dimensionality reduction and only represents the probability of the center of the target being detected under category-independent conditions. Therefore, this feature output is called a "category-independent target probability distribution map."
[0107] Since the "category-independent target probability distribution map" comes entirely from the heat map features in the category localization branch, it is fully capable of representing the optimal center position distribution of the category localization branch for all category target predictions. Guided by the probability distribution map as training weights, the detection network can adjust the attention of the coordinate regression prediction task to the corresponding spatial position with the help of the coordinate compensation branch. Through the coordinate compensation branch, targeted learning is performed on the spatial position of interest to the category localization branch, achieving consistent coupling of the category localization task and the coordinate prediction task. This ensures that the category localization results and coordinate prediction results of the detection network achieve optimal center alignment at the same spatial position, resulting in more accurate and reliable coordinate predictions.
[0108] In summary, in the design of the detection head structure of the ship detection network, the embodiment of the present invention addresses the problem of misalignment of the optimal prediction centers between parallel branches in a decoupled form, and proposes a coordinate alignment compensation structure CAC to achieve unified alignment of the category positioning task and the coordinate prediction task in spatial position. By designing a "category-independent target probability distribution map" and a coordinate compensation branch, the CAC module focuses the attention of the coordinate prediction task on the spatial position of interest to the category positioning branch, and strives to ensure that the final detection output can simultaneously achieve optimal category positioning and optimal coordinate regression, that is, the detection output can simultaneously achieve the maximum value of the Cls score and the IoU score.
[0109] Furthermore, in an embodiment of the present invention, a more accurately adapted loss function is designed for the network model. The loss function is applied to the training phase of the deep learning method to measure the degree of difference between the predicted value and the true value, and to guide the parameter update of the convolutional neural network according to the gradient change. During the training process of the detection network, when the images in the data set and their corresponding true annotations are input in batches, the network will perform forward reasoning based on the current parameter model to obtain the predicted output; for the difference between the actual output and the annotation information on the positive and negative sample areas of each branch in the detection head structure, the network completes the loss value calculation according to the pre-designed loss function; during the gradient backpropagation process, the network will update each learnable parameter according to the gradient change of the loss value, reduce the loss value between the predicted output and the true annotation, and make the predicted value of the detection network in the subsequent reasoning output as close to the true value as possible, thereby achieving a guiding role in the overall network learning optimization.
[0110] The detection head structure of the surface ship target detection network includes three parallel branches. Therefore, in the design process of the loss function, it is necessary to specifically consider the category positioning branch, coordinate regression branch, and coordinate compensation branch, so that the network can comprehensively adjust the parameter models of each branch during the training phase, and maximize the overall network detection performance after learning optimization. The design of the overall loss function is shown in formula (6):
[0111]
[0112] In formula (6), L represents the overall loss of the detection network; L loc Indicates the loss size of the category localization branch; L reg Indicates the loss size of the coordinate regression branch; L com The loss size of the coordinate compensation branch; ω * The weights of the losses corresponding to different branches in the overall loss can be determined as 1, 5, and 3 in a preferred embodiment;
[0113]
[0114] In formula (7), M represents the number of annotation information GT contained in the picture participating in forward reasoning; H ijc H represents the matrix of eye values constructed based on the center position of the annotation box GT in the image. All values are 0 except for the central area which follows the Gaussian distribution. ijc =1 indicates the spatial position corresponding to the key point of the center of the annotation box on the target feature; Represents the heat map feature matrix obtained after the network performs forward inference; α and β represent the hyperparameter design in Focal Loss, and are preferably set to 2 and 4.
[0115] For the category positioning branch in the detection network, the category positioning loss function L is designed in the form of Focal Loss loc As shown in formula (7), the reason is that: for the spatial position H corresponding to the key point of the target annotation box center ijc =1, the first term in the upper part of formula (7) represents the correction weight, the second This means that the normal loss (negative value) is calculated using the logarithmic function, and the expected value of this part is 1, that is, The closer the predicted value is to 0, the greater the absolute value of the loss. This part of the function indicates that if the predicted value given by the heat map feature obtained by forward reasoning at this spatial position is close to 1, it means that the training sample at the current position is a simple sample, and the detection network does not need to pay too much attention to it during the training process, so the first correction weight is small; if the predicted value at this spatial position is small, or even close to 0, it means that there is a difficult sample at the current position, and a larger weight setting is required through the first term of the function, so that the detection network focuses on optimizing this target; for other cases other than the position of the key point at the center of the target annotation box, the design of the second and third terms in the lower part of formula (7) is the same as before, except that the expected value of other positions outside the center of the annotation box is 0, so the calculation object is swapped. The position is obtained In addition, the first item (1-H ijc ) β The setting is to ensure that the loss function L loc Do not pay too much attention to the influence of samples near the center of the Gaussian region. This is because the detection network still needs to focus on the center of the target. The sample setting in the Gaussian region is only to improve the training efficiency of the network. If too high a weight is given to samples near the center, the detection network will give redundant detection outputs in the center area. ijc ) β and Under the common setting of loc It does not pay too much attention to sample points that are close or far from the center, and at the same time, it also ensures that the loss of negative samples will not be too large, which is equivalent to controlling the imbalance between positive and negative samples and ensuring that the training of the detection network is stable and efficient.
[0116] For the coordinate regression branch of the network, the object that needs to be optimized and learned during the training and inference stages is the coordinate feature of size W / 4×H / 4×4. The intuitively corresponding evaluation object is the intersection over union (IoU) of the target detection box and the annotation box. The larger the IoU value, the closer the prediction result is to the actual annotation. However, since the original IoU design cannot give accurate calculation results for the case where the detection box and the annotation box have no intersection at all, the related loss function design using IoU cannot give accurate gradient changes for the above situation until the network is trained and optimized. GIoU (Generalized Intersection over Union) is chosen to measure the degree of overlap between the detection box and the annotation box and complete the coordinate regression loss function L reg The specific function expression is shown in formula (8).
[0117]
[0118] In formula (8), A m Represents the Gaussian sample area in the target annotation box; N represents the Gaussian sample area A m The number of sample points within ;
[0119] B ij Represents the Gaussian sample area A m The coordinate regression targets of the samples at each position i, j in the image are the coordinates l, r, t, b of the annotation box; Represents the coordinate output obtained at the corresponding sample position after the network performs forward reasoning W ij Represents the Gaussian sample area A m The loss weight of each sample in .
[0120] In the loss calculation corresponding to the coordinate regression branch, the loss function L reg For each labeled box, the central Gaussian area A m Each position i,j in the is based on the coordinate features predicted by forward reasoning And the ideal coordinate feature B obtained according to the annotation box design ij GIoU calculation was performed and the GIoU loss at the corresponding position was obtained However, in the process of summing up the GIoU loss at each sample position of each target, considering that the Gaussian regions obtained after processing targets of different sizes are different in size, small targets have fewer sample points and a smaller loss ratio than large targets, causing the detection network to treat targets of different sizes differently during the training process. To address the problem of sample imbalance between targets of different sizes, a weight W for each target sample in the loss calculation process is proposed. ij The specific function expression is shown in formula (9).
[0121]
[0122] In formula (9), a m Indicates the area of the annotation box; G m (i, j) represents the Gaussian distribution probability value corresponding to the sample at each position in the annotation box.
[0123] The loss weight W at each sample position ij Set to solve the coordinate regression loss L reg The sample imbalance problem in . For each Gaussian sample area in the annotation box, W ijFirst, by normalizing the Gaussian probability, we ensure that targets of different sizes have the same weight ratio, and at the same time ensure that the loss function pays more attention to the samples in the central area of the Gaussian region; then we add the annotation box a m The logarithm of loga m The normalization result is scaled as a coefficient so that the magnitude of the coordinate regression loss is not too small. In addition, giving a slightly larger weight setting to large-sized targets also helps the detection network to predict the regression of boundary values far from the center of large targets.
[0124] For the coordinate compensation branch in the detection network, since its branch main structure and prediction output type are consistent with the coordinate regression branch, the loss function L com The design is different from the previous coordinate regression loss L reg The same function form is used. The only difference is that the information of “target probability distribution map independent of category” is introduced, so that the coordinate compensation branch can give the most accurate coordinate prediction result at the optimal prediction position of the category positioning branch. As shown in formula (10), the loss function L com Using the “target probability distribution map that is independent of category” W cac The probability value in is used to re-assign the GIoU of each sample, which is equivalent to paying more attention to the samples at the position of the category localization branch and suppressing the weights of other samples, so that the detection network can further optimize the samples output as the prediction box and obtain more accurate and reliable coordinate predictions.
[0125]
[0126] In formula (10), λ represents the hyperparameter used by the coordinate compensation branch to redistribute the weight of GIoU during the training phase, and here λ is set to 0.5; W cac Represents the weighted probability corresponding to the “category-independent target probability distribution map” in the coordinate alignment compensation module.
[0127] In summary, for the loss function used in the ship detection network during the training phase, the embodiment of the present invention designs and proposes a corresponding category definition loss L according to the task characteristics of each parallel branch in the detection head structure. loc , coordinate regression loss L reg and coordinate compensation loss L com After considering and solving problems such as the imbalance of positive and negative samples and the imbalance of samples between targets of different sizes in the loss function, a more accurately adapted loss function was finally obtained. This can better guide the update and optimization of the parameter model during the gradient backpropagation process in the training phase, ensuring the ultimate performance of the surface ship target detection method.
[0128] Embodiment 2 of the present invention
[0129] The key point-based anchor-free frame sea surface ship target detection system 1100 provided in the second embodiment of the present invention can execute the key point-based anchor-free frame sea surface ship target detection method provided in the first embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. The device can be implemented by software and / or hardware (integrated circuit) and can generally be integrated into a server or terminal device. Figure 11 1 is a structural diagram of a key point-based anchor-free sea surface ship target detection system 1100 in Example 2 of the present invention. Figure 11 The key point-based anchor-free sea surface ship target detection system 1100 of the embodiment of the present invention may specifically include:
[0130] A sea surface ship detection dataset building unit 1110 is used to build a large-scale sea surface ship detection dataset based on the crawler algorithm and the diversity of ship data;
[0131] Constructing an anchor-free ship target detection network model unit 1120, which is used to construct an anchor-free ship target detection network model based on key points. The anchor-free ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output. The Head includes a category positioning branch and a coordinate regression branch. The two branches perform different calculations on the same input feature representation and then integrate the results to obtain a predicted frame output;
[0132] A network model training unit 1130 is configured to train the key point-based anchor-free ship target detection network model;
[0133] The prediction unit 1140 is configured to input the test data into the trained key point-based anchor-free ship target detection network model for prediction and output a predicted frame.
[0134] In addition to the above-mentioned units, the key point-based anchor-free sea surface ship target detection system 1100 may also include other components. However, since these components are irrelevant to the content of the embodiment of the present disclosure, their illustration and description are omitted here.
[0135] The specific working process of the key point-based anchor-free frame sea surface ship target detection system 1100 is described in the above-mentioned key point-based anchor-free frame sea surface ship target detection method embodiment 1, and will not be repeated here.
[0136] Embodiment 3 of the present invention
[0137] The system according to the embodiment of the present invention can also be used by Figure 12 The architecture of the computing device shown is implemented. Figure 12 The architecture of the computing device is shown in FIG. Figure 12 As shown, a computer system 1201, a system bus 1203, one or more CPUs 1204, an input / output 1202, a memory 1205, etc. The memory 1205 can store various data or files used for computer processing and / or communication, as well as program instructions including the method of Example 1 executed by the CPU. Figure 12 The architecture shown is only exemplary and may be adjusted based on actual needs when implementing different devices. Figure 12 One or more components in. The memory 1205, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the anchor-free sea surface ship target detection method based on key points in the embodiment of the present invention (for example, the sea surface ship detection dataset construction unit 1110, the anchor-free ship target detection network model construction unit 1120, the network model training unit 1130 and the prediction unit 1140 in the key point-based anchor-free sea surface ship target detection system 1100). One or more CPUs 1204 execute various functional applications and data processing of the system of the present invention by running the software programs, instructions and modules stored in the memory 1205, that is, to implement the above-mentioned anchor-free sea surface ship target detection method based on key points, which includes:
[0138] Construct a large-scale surface ship detection dataset based on crawler algorithms and the diversity of ship data;
[0139] Constructing a keypoint-based anchor-free frame ship target detection network model, the anchor-free frame ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output; the Head includes a category positioning branch and a coordinate regression branch, the two branches perform different calculations on the same input feature representation, and then integrate the results to obtain a predicted frame output;
[0140] The key point-based anchor-free frame ship target detection network model is trained, and the test data is input into the trained key point-based anchor-free frame ship target detection network model for prediction, and a prediction frame is output.
[0141] Of course, the processor of the server provided by the embodiment of the present invention is not limited to executing the method operations described above, but can also execute relevant operations in the key point-based anchor-free sea surface ship target detection method provided by any embodiment of the present invention.
[0142] The memory 1205 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the memory 1205 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the memory 1205 may further include memory remotely located relative to one or more CPUs 1204, and these remote memories may be connected to the device via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0143] The input / output 1202 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The input / output 1202 may also include a display device such as a display screen.
[0144] Embodiment 4 of the present invention
[0145] The embodiments of the present invention may also be implemented as a computer-readable storage medium. A computer-readable storage medium according to Embodiment 4 may store a computer program. When executed by a processor, the computer program may perform the anchor-free sea surface vessel target detection method based on key points according to Embodiment 1 of the present invention, as described with reference to the accompanying drawings.
[0146] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present invention is not limited to the method operations described above, and can also execute related operations in the key point-based anchor-free sea surface ship target detection method provided in any embodiment of the present invention.
[0147] The computer-readable storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0148] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0149] The program code embodied on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0150] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0151] In order to better demonstrate the effects of the present invention, the embodiment of the present invention provides a specific example. Compared with other ship detection algorithms, the method of the present invention can specifically propose a sea surface ship detection dataset for full training of the deep learning algorithm, so that the ship detection algorithm can be excellently applied to various complex sea surface scenes, including coastal docks, ocean scenes, and undulating sea wave scenes. In addition, the algorithm design in the present invention can also achieve excellent detection performance under training with other datasets. By using the public dataset SeaShips (7000) and the sea surface ship detection dataset proposed in the method of the present invention to fully train the ship detection algorithm, targeted ship detection models are obtained respectively, showing its superiority in detecting difficult targets such as small and medium-sized ships and ships obscured by waves in the input image.
[0152] First, the effect of the present invention is further illustrated by combining the specific detection output on the SeaShips (7000) validation set. Figure 13 The figure shows the detection effect of the ship detection algorithm of the present invention under the interference of the long tail of the ship. It can be seen that the algorithm can accurately predict the bounding box of the ship target in this case. The obtained bounding box fits closely with the visible part of the ship on the wave side. Figure 14 The algorithm demonstrates its detection performance for small-sized ship targets. It can be clearly seen that in different scenarios, the ship detection algorithm accurately predicts ship targets visible to the human eye in the input image. Figure 15 The ship detection algorithm demonstrates its effectiveness in detecting mutual occlusion of ships in a multi-target image. Even though some ship targets are largely occluded by similar ships, the proposed ship detection algorithm accurately outputs detections, with its detection box closely fitting the target. The boundaries of the occluded ships are optimally predicted relative to the visible edge. This visualization, based on the SeaShips (7000) dataset, demonstrates the superiority of the proposed method.
[0153] Secondly, after completing the construction of the sea surface ship dataset as described in the invention content, the algorithm was fully trained on the dataset and the corresponding performance evaluation was performed on the validation set images. Figure 16 The ship detection algorithm proposed in this paper demonstrates the detection output of ships of different sizes in ocean scenes. It can be seen that the algorithm can accurately predict small ships at long distances that are visible to the human eye. Figure 17The algorithm is demonstrated to detect obscured ship targets in a large sea wave scene. The output results show that the present invention can successfully complete the detection output when the wave features cover a large area of ship features, and the boundary lines of the detection frame are as close to the visible part of the ship as possible. The above visualization results have demonstrated the superiority and applicability of the proposed ship detection algorithm. The surface ship detection algorithm of the present invention is well suited for actual marine application scenarios. It can be fully trained through a self-built surface ship dataset to achieve accurate detection of difficult targets such as small and medium-sized ships and ships obscured by waves, ensuring that all ship targets are inspected.
[0154] In summary, it can be seen from the embodiments that the present invention provides a method, system and storage medium for detecting sea surface ship targets without anchor frames based on key points. The method crawls images of relevant ship observation websites through a crawler algorithm, screens and organizes them under the consideration of diversity, and finally completes the construction of a ship detection data set under precise manual annotation, thereby solving the previously mentioned problem of uneven quality of current public ship data sets; and for difficult targets such as small and medium-sized ships in visible light images and ships obscured by waves, which focus on underlying detail texture information, the method of the present invention chooses to achieve richer gradient combinations by reconstructing the backbone network, retaining richer underlying detail texture features and reducing the amount of calculation, and at the same time, by designing an adaptive weighted feature fusion strategy to obtain a more comprehensive and balanced feature representation to achieve algorithm optimization; in addition, for the problem of misalignment of the optimal prediction centers between parallel branches in the decoupled detection head structure, the method of the present invention chooses to alleviate the problem to a certain extent through the design of a coordinate alignment compensation module, so that the detection network can give a more accurate and reliable detection frame prediction, thereby further improving the overall accuracy of the ship detection algorithm. In summary, the beneficial effects of the present invention are as follows:
[0155] (1) The key point-based anchor-free sea surface ship target detection method provided by the present invention can omit the setting of the anchor mechanism in the overall design, so that the detection process does not need to perform a large amount of redundant calculations on numerous candidate areas; in addition, after omitting the anchor mechanism, the redundant predictions contained in the detection output are greatly reduced, and post-processing operations such as non-maximum suppression can be further omitted, making the overall structure more concise. Therefore, the ship detection method disclosed by the present invention has the characteristics of simplicity and efficiency;
[0156] (2) Through the design of a crawler algorithm and careful consideration of the diversity of sea-surface ship images, this paper is able to construct a large-scale, multi-category ship detection dataset. The proposed ship dataset can further fully train the ship detection algorithm, making it well-suited for multi-category ship target detection tasks in complex sea environments.
[0157] (3) The present invention addresses the problem of detecting difficult targets such as small and medium-sized ships and ships obscured by waves in complex environments faced by existing ship detection algorithms. It uses a cross-stage local network to reconstruct the backbone network to achieve richer gradient combinations, while reducing the amount of calculation and retaining rich underlying detailed texture information. It also proposes an adaptive weighted feature fusion method to comprehensively treat high-level abstract semantic information and low-level detailed texture information in different feature representations, thereby obtaining a more comprehensive and balanced feature representation. Through the above design, the ship detection algorithm of the present invention can ensure the stability of detection performance in complex scenarios.
[0158] (4) The present invention addresses the problem of misalignment of optimal prediction centers between branches in the decoupled detection head structure, and proposes a coordinate alignment compensation module to achieve synchronous interaction of information between branches, so that the detection network can adjust the attention of the coordinate regression prediction task to the corresponding spatial position with the help of the coordinate compensation branch, thereby obtaining more accurate and reliable coordinate prediction results, ensuring the accuracy of the algorithm and its superiority compared with other ship detection algorithms.
[0159] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for detecting sea surface ship targets without anchor frames based on key points, characterized in that: The method comprises the following steps: Construct a large-scale surface ship detection dataset based on crawler algorithms and the diversity of ship data; Constructing a keypoint-based anchor-free frame ship target detection network model, the anchor-free frame ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output; the Head includes a category positioning branch and a coordinate regression branch, the two branches perform different calculations on the same input feature representation, and then integrate the results to obtain a predicted frame output; Training the key point-based anchor-free frame ship target detection network model, inputting test data into the trained key point-based anchor-free frame ship target detection network model for prediction, and outputting a predicted frame; The Head uses the coordinate alignment compensation structure CAC to set up an interactive connection to transfer the feature information in the category positioning branch to the coordinate regression branch, so as to ensure the spatial position alignment of the optimal prediction centers on the two branches; wherein, the coordinate alignment compensation structure CAC includes a coordinate compensation branch structure and a training guidance module based on weight distribution.
2. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 1 is characterized in that: The category positioning branch obtains a heat map with C channels through convolution calculation, where C is the number of target categories to be detected contained in the current detection data set. The category positioning branch obtains a new heat map output by performing maximum pooling on the heat map in the channel dimension, where the high probability position on the channel feature map corresponding to each category represents the category prediction and key point position prediction (c, x, y) of the target to be detected, where c represents the category prediction and (x, y) represents the key point position; the coordinate regression branch obtains a coordinate prediction feature with 4 channels through convolution calculation, and At the same spatial position of the key point position (x, y), the four coordinate prediction features on different channels of the coordinate prediction feature represent the relative distances (l, r, t, b) between the four boundaries of the detection box and the target center key point; after the category positioning branch completes the detection of the target key point (c, x, y), the coordinate regression result (l, r, t, b) at the current position is obtained on the coordinate regression branch by corresponding the target key point one by one, and the overall detection is completed by determining the prediction result (c, x, y, l, r, t, b) of each target to be detected.
3. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 1, characterized in that: The Backbone is a CSP-Darknet backbone network obtained by reconstructing Darknet-53 using the cross-stage local network CSPNet.
4. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 3 is characterized in that: A fast spatial pyramid pooling (SPPF) module is set at the end of the CSP-Darknet backbone network structure to improve the receptive field size of the CSP-Darknet backbone network.
5. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 3 is characterized in that: The Bottleneck module in the Darknet-53 is reconstructed using the cross-stage local network CSPNet to obtain CSP-Bottleneck. In the CSP-Bottleneck structure, the input features are first divided into two halves using a 1×1 convolution transformation to obtain two features. The two features are processed differently. One uses the original Bottleneck module to complete the feature extraction calculation, and the other is directly passed backward to complete the splicing operation with the output features of the Bottleneck module to obtain the final output features.
6. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 1, characterized in that: Neck uses an adaptive weighted feature fusion strategy to perform weighted fusion on features of different scales in each layer of the feature pyramid to obtain a feature representation of adaptive distribution of high-level abstract semantic information and low-level detailed texture information. The adaptive weighted feature fusion strategy specifically includes: For the features of a certain level in the feature pyramid, the features of other levels are adjusted to the same resolution and the same number of channels for integration, and the corresponding convolutional layers are designed for the features of each level to calculate the adaptive weighting weights; The convolutional layer that calculates weights is continuously optimized through network training learning methods, so that the convolutional layer can accurately obtain the optimal weight corresponding to each feature in the forward reasoning phase of the network; At each spatial position, if the feature carries information that contradicts the accuracy of the detection, the adaptive weight of the feature will be reduced. If the feature carries more discriminative clues at the spatial position, the adaptive weight of the feature will be enhanced.
7. The method for detecting sea surface ship targets without anchor frames based on key points according to claim 2, characterized in that: The coordinate compensation branch is used to compensate and correct the coordinates given by the current coordinate prediction result. The coordinate compensation branch is set in parallel with the category positioning branch and the coordinate regression branch. The input feature of the coordinate compensation branch is the feature after the feature representation output by Neck and the feature representation output by the coordinate regression branch are spliced. The coordinate compensation branch performs convolution calculation on the input feature to obtain the feature output; the training guidance module based on weight distribution obtains the feature map output by convolution calculation for the heat map of the category positioning branch. Each position of the feature map is a probability value in the numerical interval [0,1]. The probability value represents the probability of occurrence of the center of the target to be detected at each position. The training guidance module based on weight distribution uses a two-dimensional Gaussian kernel function to perform Gaussian distribution normalization on the high-probability position and its surrounding area in the feature map, which is used to perform coordinate correction optimization on the center position of the high-probability area during training.
8. A key point-based anchor-free sea surface ship target detection system, characterized in that: include: Construct a sea surface ship detection dataset unit, which is used to construct a large-scale sea surface ship detection dataset based on the crawler algorithm and the diversity of ship data; Constructing an anchor-free ship target detection network model unit, which is used to construct a key point-based anchor-free ship target detection network model. The anchor-free ship target detection network model is a Backbone-Neck-Head structure, wherein the Backbone extracts features from the input image to obtain deep features, the Neck organizes and fuses the multi-scale features of the image through a feature pyramid, and restores the deep features to a feature representation suitable for the Head to calculate the detection frame output. The Head includes a category positioning branch and a coordinate regression branch. The two branches perform different calculations on the same input feature representation and then integrate the results to obtain a prediction frame output; A network model training unit, used for training the key point-based anchor-free ship target detection network model; A prediction unit, configured to input the test data into the trained key point-based anchor-free frame ship target detection network model for prediction and output a predicted frame; The Head uses the coordinate alignment compensation structure CAC to set up an interactive connection to transfer the feature information in the category positioning branch to the coordinate regression branch, so as to ensure the spatial position alignment of the optimal prediction centers on the two branches; wherein, the coordinate alignment compensation structure CAC includes a coordinate compensation branch structure and a training guidance module based on weight distribution.
9. A key point-based anchor-free sea surface ship target detection system, characterized in that: include: processor; and a memory, wherein a computer executable program is stored in the memory, and when the computer executable program is executed by the processor, the key point-based anchor-free sea surface ship target detection method according to any one of claims 1 to 7 is executed.
10. A storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the anchor-free sea surface ship target detection method based on key points is implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Ship target detection method, terminal equipment and storage medium
CN114299303A
Infrared image small target detection method
CN115546500A