YOLOv8-based optical remote sensing image ship detection method and device

By introducing an intelligent ship detection model with a large separation convolution kernel and a parameter-free attention module in YOLOv8, the problem of low detection accuracy of small dense ship targets in remote sensing images is solved, and higher detection accuracy and feature representation capabilities are achieved. .

CN118608758AActive Publication Date: 2024-09-06XIDIAN UNIV +1

Patent Information

Application Number
CN202410655076.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-06
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

When detecting remote sensing ship targets based on convolutional neural networks, the length and width of the ship targets vary greatly, and the near-shore ships are relatively dense, resulting in low detection accuracy, especially for small dense ship targets.

Method used

The optical remote sensing image ship detection method based on YOLOv8 is used to build an intelligent ship detection model, including the Backbone module and the Neck module. The Backbone module dynamically adjusts the receptive field through a large separation convolution kernel and an expanded residual sub-module, and the Neck module introduces no parameters. Attention module enhances feature representation capabilities.

Benefits of technology

It improves the detection accuracy of small dense ship targets, enhances feature representation capabilities, and improves detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608758A
    Figure CN118608758A
Patent Text Reader

Abstract

The invention provides an optical remote sensing image ship detection method and device based on YOLOv8, and relates to the technical field of remote sensing image recognition. The method comprises the steps that an intelligent ship detection model is constructed, a first data set and a second data set are preprocessed respectively, and a first ship image and a second ship image with labels are obtained; sequentially inputting the first ship image and the second ship image into an intelligent ship detection model, and training the intelligent ship detection model to obtain a trained intelligent ship detection model; inputting the predicted image into a trained intelligent ship detection model, and detecting predicted ship information; and post-processing the predicted ship information to obtain a detection image with a label. A Backbone module of the intelligent ship detection model comprises an LSKblock and a C2f module which introduces a DWR module, so that the feature representation of a feature pattern is comprehensive, and a Neck module which introduces SimAM, so that the detection precision of a tiny and dense ship target is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote sensing image recognition, and in particular to a method and device for detecting ships in optical remote sensing images based on YOLOv8. Background Art

[0002] Remote sensing technology is a scientific and technological means of long-distance observation and measurement. It uses various sensors such as optical, microwave and infrared sensors to obtain information about targets such as the earth's surface, atmosphere and water bodies through carriers such as satellites, aircraft or drones, and converts it into recognizable remote sensing images or data. Remote sensing images include remote sensing optical ship images. The use of remote sensing optical ship images for ship target detection has received great attention in the field of marine remote sensing. Ship target detection can timely and effectively discover and extract target ship information.

[0003] At present, remote sensing ship target detection based on convolutional neural networks requires the collection and annotation of remote sensing image data of ships and non-ships; the selection of convolutional neural network structure, training on the training set, and monitoring the model performance to prevent overfitting; in the model evaluation stage, the test set is used to evaluate the model performance, and the hyperparameters are adjusted to optimize the performance; finally, the trained model is deployed in the actual application environment, and the threshold and post-processing are adjusted as needed to obtain the ship image. However, when detecting remote sensing ship targets based on convolutional neural networks, due to the huge differences in the length and width of ship targets, the relatively dense ships near the coast, and the very small ship targets relative to the background, the performance of detecting ship targets is greatly reduced, resulting in low detection accuracy for small and dense ship targets. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a ship target detection method and device based on YOLOv8 to solve the problem of low detection accuracy of small and dense ship targets.

[0005] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of the present invention provides a method for detecting ships in optical remote sensing images based on YOLOv8, the method comprising:

[0007] Construct an intelligent ship detection model, which includes the Backbone module and the Neck module of YOLOv8 in sequence. The Backbone module includes a large separation convolution kernel module and a channel-to-pixel module including a dilated residual submodule. The Neck module includes a parameter-free attention module.

[0008] Preprocessing the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations, wherein the target format of the annotations is suitable for the intelligent ship detection model;

[0009] Inputting a plurality of first ship images and a plurality of second ship images into an intelligent ship detection model in sequence, training the intelligent ship detection model, and obtaining a trained intelligent ship detection model;

[0010] Input the predicted image into the trained intelligent ship detection model to detect the predicted ship information;

[0011] The predicted ship information is post-processed to obtain a labeled detection image.

[0012] A second aspect of the present application provides a ship detection device based on optical remote sensing images of YOLOv8, the device comprising:

[0013] A construction module is used to construct an intelligent ship detection model. The intelligent ship detection model includes a Backbone module and a Neck module of YOLOv8 in sequence. The Backbone module includes a large separation convolution kernel module and a channel-to-pixel module including a dilated residual submodule. The Neck module includes a parameter-free attention module.

[0014] A preprocessing module, used to preprocess the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations, wherein the target format of the annotations is suitable for the intelligent ship detection model;

[0015] A training module, used for sequentially inputting a plurality of first ship images and a plurality of second ship images into an intelligent ship detection model, training the intelligent ship detection model, and obtaining a trained intelligent ship detection model;

[0016] A detection module is used to input the predicted image into the trained intelligent ship detection model to detect the predicted ship information;

[0017] The post-processing module is used to post-process the predicted ship information to obtain a labeled detection image.

[0018] Compared with the prior art, the optical remote sensing image ship detection method and device based on YOLOv8 provided by the present invention constructs an intelligent ship detection model, pre-processes the first data set and the second data set respectively, and obtains corresponding multiple first ship images with annotations and multiple second ship images with annotations; inputs the multiple first ship images and multiple second ship images into the intelligent ship detection model in sequence, trains the intelligent ship detection model, and obtains a trained intelligent ship detection model; inputs the predicted image into the trained intelligent ship detection model to detect the predicted ship information; and post-processes the predicted ship information to obtain a detection image with annotations. In this way, since the Backbone module of the intelligent ship detection model includes LSKblock and the C2f module of the DWR submodule, the receptive field of the network can be dynamically adjusted, the ability to extract information of different scales is enhanced, the feature representation of the feature map is more comprehensive, and the Neck module of SimAM is introduced, the detection accuracy of small and dense ship targets can be higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0020] Figure 1 Schematic diagram of the process of ship detection method based on optical remote sensing image based on YOLOv8 Figure 1 ;

[0021] Figure 2 Schematic diagram of the process of ship detection method based on optical remote sensing image based on YOLOv8 Figure 2 ;

[0022] Figure 3 The network structure diagram of the Backbone module is schematically shown;

[0023] Figure 4 The network structure diagram of the channel-to-pixel module including the dilated residual submodule is schematically shown;

[0024] Figure 5 The network structure diagram of the Neck module is schematically shown;

[0025] Figure 6 The network structure diagram of the intelligent ship detection model is schematically shown;

[0026] Figure 7 A diagram schematically shows a comparison of the training accuracy of the first data set;

[0027] Figure 8 The structure diagram of the optical remote sensing image ship detection device based on YOLOv8 is schematically shown. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0029] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in the present invention should have the common meanings understood by those skilled in the art to which the present invention belongs.

[0030] The method in the embodiment of the present invention is described in detail below.

[0031] Figure 1 The flowchart of the method for detecting ships in optical remote sensing images based on YOLOv8 in an embodiment of the present invention is schematically shown. Figure 1 As shown, the method may include:

[0032] S101. Build an intelligent ship detection model.

[0033] Among them, the intelligent ship detection model includes the Backbone module and Neck module of YOLOv8 in sequence. The Backbone module includes a large separation convolution kernel module, a channel to pixel module including a dilated residual submodule, and the Neck module includes a parameter-free attention module.

[0034] The Backbone module of YOLOv8 includes a large separation convolution kernel module (LSKblock) and a channel-to-pixel module (C2f) including a dilation wise residual submodule (DWR). The C2f module including DWR can be expressed as C2f_DWR.

[0035] LSKblock can dynamically adjust the network's receptive field to improve the detection accuracy of tiny ship targets. The C2f module containing DWR can reduce the increase in network depth caused by LSKblock, and can fuse multi-scale receptive fields to generate feature maps, making the feature representation of feature maps more comprehensive.

[0036] The Neck module is a module that contains a Simple Parameter-Free Attention Module (SimAM), which can capture the saliency and importance in the feature map, so that important features get higher weights, thereby enhancing the representation ability of the features and helping to improve the performance of tasks such as ship target detection and classification.

[0037] S102: Preprocess the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a corresponding plurality of second ship images with annotations.

[0038] Among them, the annotated target format is suitable for the intelligent ship detection model.

[0039] The first data set may be a HRSC2016 data set, and the second data set may be a FGSD data set. There may be multiple types of data sets, and the types of data sets are not specifically limited herein. The annotation formats of the first data set and the second data set are different. Both the first data set and the second data set are optical remote sensing images containing ship targets.

[0040] Preprocessing may include image segmentation, annotation format conversion, and expansion processing, and the expansion processing includes horizontal and vertical flipping, truncation and splicing, adding noise, and random processing and splicing.

[0041] The preprocessed images containing ship targets are selected as training samples.

[0042] The order of step S101 and step S102 is not specifically limited here. Step S101 may be performed first and then step S102, or step S102 may be performed first and then step S101.

[0043] S103: input the plurality of first ship images and the plurality of second ship images into the intelligent ship detection model in sequence, train the intelligent ship detection model, and obtain a trained intelligent ship detection model.

[0044] All the labeled first ship images in the preprocessed first data set and all the second ship images in the preprocessed second data set are sequentially input into the intelligent ship detection model, and the intelligent ship detection model is trained until the model reaches a preset training round or the loss value no longer decreases, and the evaluation meets the standard, thereby obtaining a trained intelligent ship detection model.

[0045] S104: Input the predicted image into the trained intelligent ship detection model to detect the predicted ship information.

[0046] The predicted ship information includes rotation angle, preset bounding box, preset category confidence and target confidence.

[0047] S105: Post-process the predicted ship information to obtain a marked detection image.

[0048] The rotation angle, preset bounding box, preset category confidence and target confidence are post-processed to obtain a labeled detection image.

[0049] Post-processing includes non-maximum suppression, bounding box decoding, category confidence threshold screening, coordinate decoding and labeling.

[0050] Based on the above Figure 1 It can be seen from the implementation method that the embodiment of the present invention constructs an intelligent ship detection model, pre-processes the first data set and the second data set respectively, and obtains corresponding multiple first ship images with annotations and multiple second ship images with annotations; the multiple first ship images and multiple second ship images are sequentially input into the intelligent ship detection model, and the intelligent ship detection model is trained to obtain a trained intelligent ship detection model; the predicted image is input into the trained intelligent ship detection model to detect the predicted ship information; the predicted ship information is post-processed to obtain a detection image with annotations. In this way, since the Backbone module of the intelligent ship detection model includes LSKblock and the C2f module of the DWR submodule, the receptive field of the network can be dynamically adjusted, the ability to extract information of different scales is enhanced, the feature representation of the feature map is more comprehensive, and the Neck module of SimAM is introduced, the detection accuracy of small and dense ship targets can be higher.

[0051] As a refinement and expansion of the above embodiment, Figure 2 The process of a ship detection method based on optical remote sensing image YOLOv8 in an embodiment of the present invention is as follows Figure 2 , see Figure 2 As shown, an optical remote sensing image ship detection method based on YOLOv8 provided by an embodiment of the present invention may include:

[0052] S201. Construct an intelligent ship detection model.

[0053] Among them, the intelligent ship detection model includes the Backbone module, Neck module and Head module of YOLOv8 in sequence, and the Head module includes 1 convolution group module and 1 ordinary convolution module in sequence.

[0054] The Backbone module includes two convolution group modules (ConvModul), one channel-to-pixel module (i.e., the C2f module containing DWR), one convolution group module, one channel-to-pixel module (i.e., the C2f module containing DWR), one convolution group module, one channel-to-pixel module (i.e., the C2f module containing DWR), one convolution group module, one channel-to-pixel module (i.e., the C2f module containing DWR), one large separation convolution kernel module, and one fast spatial pyramid pooling module (Spatial PyramidPooling Fast, SPPF).

[0055] Figure 3 The network structure diagram of the Backbone module is schematically shown. The Backbone module introduced with LSKblock includes 1 ConvModul, 1 ConvModul, 1 C2f (i.e., C2f module including DWR), 1 ConvModul, 1 C2f (i.e., C2f module including DWR), 1 ConvModul, 1 C2f (i.e., C2f module including DWR), 1 ConvModul, 1 C2f (i.e., C2f module including DWR), 1 LSKblock, and 1 SPPF from top to bottom. The second C2f (i.e., C2f module including DWR), the third C2f (i.e., C2f module including DWR), and SPPF are taken as outputs.

[0056] Among them, the channel-to-pixel module includes 1 convolution group module, 1 segmentation layer (Split), n dilated residual sub-modules, 1 concatenation layer (Concat) and 1 convolution group module in sequence.

[0057] Figure 4 The network structure diagram of the channel-to-pixel module including the dilated residual submodule is schematically shown. The C2f module introducing DWR includes 1 ConvModul, 1 Split, n DWRs, 1 Concat and 1 ConvModul from top to bottom.

[0058] The Neck module containing SimAM includes 1 upsampling layer (Upample), 1 splicing layer, 1 channel-to-pixel module, 1 upsampling layer, 1 splicing layer, 1 C2f (i.e., the C2f module containing DWR), 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, and 1 parameter-free attention module.

[0059] Figure 5The network structure diagram of the Neck module is schematically shown. The Neck module introduced with SimAM includes 1 Upample, 1 Concat, 1 C2f (i.e., the C2f module including DWR), 1 Upample, 1 Concat, 1 C2f (i.e., the C2f module including DWR), 1 SimAM, 1 ConvModul, 1 Concat, 1 C2f (i.e., the C2f module including DWR), 1 SimAM, 1 ConvModul, 1 Concat, 1 C2f (i.e., the C2f module including DWR), and 1 SimAM. The first Concat, the second Concat, and the fourth Concat are taken as input, and the first SimAM, the second SimAM, and the third SimAM are taken as output.

[0060] Figure 6 The network structure diagram of the intelligent ship detection model is schematically shown, which includes 1 ConvModul, 1 ConvModul, 1 C2f_DWR (i.e., a C2f module containing DWR), 1 ConvModul, 1 C2f_DWR, 1 ConvModul, 1 C2f_DWR, 1 ConvModul, 1 C2f_DWR, 1 LSKblock, 1 SPPF, 1 Upample, 1 Concat, 1 C2f_DWR, 1 Upample, 1 Concat, 1 C2f_DWR, 1 SimAM, 1 ConvModul, 1 Concat, 1 C2f_DWR, 1 SimAM, 1 ConvModul, 1 Concat, 1 C2f_DWR, 1 SimAM, 1 ConvModul, 1 Concat, 1 C2f_DWR, 1 SimAM, 1 ConvModul and 1 ordinary convolution module (Conv2d).

[0061] The following steps S202 to S205 are specific operations of preprocessing the first data set and the second data set respectively to obtain corresponding multiple first ship images with annotations and multiple second ship images with annotations.

[0062] S202 , cutting the first data set and the second data set respectively according to a preset overlap ratio to obtain a corresponding plurality of first cutting images and a plurality of second cutting images.

[0063] There are ships in each of the first cutting images and each of the second cutting images.

[0064] The first data set may be a HRSC2016 data set, and the second data set may be a FGSD data set. There may be multiple types of data sets, and the types of data sets are not specifically limited herein. The annotation formats of the first data set and the second data set are different. Both the first data set and the second data set are optical remote sensing images containing ship targets.

[0065] Since the resolution of the remote sensing images in each data set is too high and the size of the ship target in the image accounts for a small proportion of the entire image, if the resize method is used to compress the image size to the corresponding resolution, the key information of the target may be lost, resulting in model training failure. Therefore, the remote sensing images with too high resolution are cut into small pieces according to the preset overlap rate, and finally multiple first cut images corresponding to the first data set and multiple second cut images corresponding to the second data set are obtained.

[0066] The preset overlap rate may be 50% overlap rate, and the resolution of the plurality of first cut images and the plurality of second cut images is 1024×1024. The plurality of first cut images and the plurality of second cut images after cutting are annotated images.

[0067] S203 : Convert the annotation formats corresponding to the first cutting images and the second cutting images into a target format to obtain a corresponding plurality of first conversion images and a plurality of second conversion images.

[0068] Among them, the target format includes the ship category. The annotated target format is suitable for the intelligent ship detection model.

[0069] Since the annotation formats of each data set (i.e., multiple first cut images and multiple second cut images) are not uniform, it is necessary to convert the annotation formats corresponding to each first cut image and each second cut image into an annotation format that conforms to the intelligent ship detection model, i.e., a target format, to obtain corresponding multiple first conversion images and multiple second conversion images. The obtained corresponding multiple first conversion images and multiple second conversion images are all images with the target format.

[0070] The target format includes the ship category and the coordinates of the four vertices of the preset bounding box. The target format is (class, x1, y1, x2, y2, x3, y3, x4, y4), where class is the ship category, (xi, yi), where i = 1, 2, 3, 4, are the position coordinates of the four vertices of the rotated preset bounding box relative to the entire image.

[0071] S204: When the number of ship categories is greater than a preset value, the corresponding plurality of first conversion images and plurality of second conversion images are determined as a plurality of first ship images and a plurality of second ship images, respectively.

[0072] After step S203, it is necessary to judge the ship category of the multiple first ship images and the multiple second ship images to determine whether the ship category is greater than a preset value. When the ship category is greater than the preset value, the corresponding multiple first conversion images and multiple second conversion images are respectively determined as multiple first ship images and multiple second ship images; when the ship category is not greater than the preset value, execute the following step S205.

[0073] The default value may be 10% of the maximum number of ship classes.

[0074] S205: When the number of ship categories is not greater than a preset value, the corresponding plurality of first converted images and plurality of second converted images are expanded to obtain a plurality of first ship images and a plurality of second ship images.

[0075] When the number of ship categories is not greater than a preset value, the corresponding multiple first conversion images and multiple second conversion images are expanded. The expansion can be horizontal and vertical flipping, which makes the target posture more diverse; it can also be interception and splicing. In order to increase the number of targets on a single image, the parts containing the targets in different images are intercepted and spliced ​​into a new image; it can also be noise disturbance, which improves the robustness of the model by randomly adding Gaussian noise; it can also be random processing splicing, which can splice multiple pictures by random scaling, random cropping, and random arrangement.

[0076] Through the above expansion, the number of small target samples and dense target samples can be increased to make the distribution of training data tend to be uniform.

[0077] S206: Input the plurality of first ship images and the plurality of second ship images into the intelligent ship detection model in sequence, train the intelligent ship detection model, and obtain a trained intelligent ship detection model.

[0078] All the labeled first ship images in the preprocessed first data set and all the second ship images in the preprocessed second data set are sequentially input into the intelligent ship detection model, and the intelligent ship detection model is trained until the model reaches a preset training round or the loss value no longer decreases, and the evaluation meets the standard, thereby obtaining a trained intelligent ship detection model.

[0079] Specifically, the parameter settings during the training process are as follows: the total number of training rounds for the HRSC2016 dataset, i.e. the first dataset, is 900, and the total number of training rounds for the FGSD dataset, i.e. the second dataset, is 300; the SGD optimizer is used to optimize the network, the initial learning rate is set to 0.01, the momentum parameter is set to 0.937, the optimizer weight decay coefficient is set to 0.0005, the target bounding box loss weight is 12.0, the category loss weight is 0.5, the DFL loss weight is 1.5, and no pre-training parameters are used in the experiment. The training set data (i.e., multiple first ship images and multiple second ship images) are put into the model. In the forward propagation, the input data is passed through the intelligent ship detection model to obtain the predicted value; then the loss between the predicted value and the true value is calculated; then the gradient is calculated through the back-propagation algorithm, and the optimizer is used to update the weight and bias of the intelligent ship detection model; finally, this process is repeated until the intelligent ship detection model reaches the preset training rounds or the loss value no longer decreases. After completing the training of the smart ship detection model, you need to evaluate the smart ship detection model. Use the test set assigned in step 1 to test the generalization ability of the model, that is, the performance of the model on unseen data. Evaluation indicators can include accuracy, precision, recall, etc. After the smart ship detection model is trained, you can save the smart ship detection model as a file for future use. When you need to use the smart ship detection model for detection, you can load the model from the file and use it directly.

[0080] S207: Input the predicted image into the trained intelligent ship detection model to detect the predicted ship information.

[0081] Specifically, the predicted image is input into the trained intelligent ship detection model to detect the predicted ship information, including:

[0082] Step A1: Input the predicted image into the Backbone module, and output the first feature map P3, the second feature map P4 and the third feature map P5.

[0083] Among them, the resolution of the first feature map is greater than the resolution of the second feature map, and the resolution of the second feature map is greater than the resolution of the third feature map.

[0084] Specifically, the predicted image is input into the Backbone module, and the first feature map, the second feature map and the third feature map are output, including:

[0085] Step A11: Input the predicted image into 2 convolution group modules, 1 channel to pixel module, 1 convolution group module and 1 channel to pixel module in sequence, and output the first feature map.

[0086] Step A12: Input the first feature map into one convolution group module and one channel into the pixel module in sequence, and output the second feature map.

[0087] Step A13: Input the second feature map into a convolution group module, a channel to pixel module, a large separation convolution kernel module, and a fast spatial pyramid pooling module in sequence, and output the third feature map.

[0088] Step A2: Input the first feature map, the second feature map and the third feature map into the Neck module, and output the fourth feature map T1, the fifth feature map T2 and the sixth feature map T3.

[0089] Specifically, the first feature map, the second feature map, and the third feature map are input into the Neck module, and the fourth feature map, the fifth feature map, and the sixth feature map are output, including:

[0090] Step A21: Input the third feature map into an upsampling layer, output the first sampling feature map, and input the first sampling feature map and the second feature map into a concatenation layer and a channel into a pixel module in sequence, and output the first intermediate feature map F1.

[0091] Step A22: Input the first intermediate feature map into an upsampling layer, output the second sampling feature map, and input the second sampling feature map and the first feature map into a concatenation layer, a channel to pixel module and a parameter-free attention module in sequence to output a fourth feature map.

[0092] Step A23: Input the fourth feature map into a convolution group module, output the second intermediate feature map, and input the second intermediate feature map and the first intermediate feature map into a concatenation layer, a channel to pixel module, and a parameter-free attention module in sequence to output the fifth feature map.

[0093] Step A24: Input the fifth feature map into a convolution group module, output the third intermediate feature map, and input the third intermediate feature map and the third feature map into a concatenation layer, a channel to pixel module, and a parameter-free attention module in sequence, and output the sixth feature map.

[0094] Step A3: The output fourth feature map, fifth feature map and sixth feature map are input into one convolution group module and one ordinary convolution module in sequence to output the predicted ship information.

[0095] The predicted ship information includes rotation angle, preset bounding box, preset category confidence and target confidence.

[0096] S208: Post-process the predicted ship information to obtain a marked detection image.

[0097] Post-processing includes non-maximum suppression, bounding box decoding, category confidence threshold screening, coordinate decoding and labeling.

[0098] Specifically, the predicted ship information includes a rotation angle, a preset bounding box, a preset category confidence, and a target confidence. The predicted ship information is post-processed to obtain a labeled detection image, including:

[0099] Step B1: According to non-maximum suppression, the preset bounding box is screened to obtain a target bounding box, which includes the original coordinates.

[0100] Non-maximum suppression will traverse all preset bounding boxes and compare the overlap between two preset bounding boxes (such as intersection ratio) with a threshold of 0.5. If the overlap between two preset bounding boxes exceeds this threshold, the lower confidence bounding box will be suppressed by the higher confidence bounding box, that is, it will be deleted from the final detection result. Non-maximum suppression can suppress and eliminate redundant and highly overlapping preset bounding boxes, and only retain those bounding boxes that are most likely to be real targets, which can improve the accuracy and efficiency of target detection.

[0101] Step B2: Filter the preset category confidences according to the preset threshold to obtain the target category confidence.

[0102] The preset category confidence is compared with the preset threshold, the preset category confidence above the preset threshold is retained, and the preset category confidence below the preset threshold is eliminated, and finally a set of preset category confidences containing only high confidence is obtained. These high-confidence sets are more likely to be real targets, thus improving the accuracy and reliability of ship target detection.

[0103] The preset threshold can be set according to the specific scenario and is not specifically limited.

[0104] Step B3: Decode the original coordinates into target coordinates.

[0105] The original coordinates are the coordinates in the range 0 to 1, and the target coordinates are the coordinates of the actual position of the bounding box.

[0106] Get the prediction values ​​related to the bounding box in the filtered target bounding box, including the center point coordinate offset, width and height scaling factors, and confidence score of the bounding box. Then, apply the center point coordinate offset to the feature map grid through decoding to obtain the center point position of the bounding box on the feature map. Similarly, the width and height scaling factors are also used to calculate the actual width and height of the bounding box on the feature map. Next, since the feature map is obtained by downsampling, it is necessary to map the decoded bounding box coordinates from the feature map space back to the original image space. Finally, adjust the decoded bounding box as needed to prevent the prediction of a bounding box that is too large or too small. The output of the bounding box decoding is the actual bounding box coordinates obtained after conversion and calculation, that is, the target coordinates.

[0107] Step B4: The rotation angle, target bounding box, target category confidence and target confidence are all marked in the predicted image to obtain a marked detection image.

[0108] The embodiments of the present invention can be further illustrated by the following experiments:

[0109] The configuration of the high-performance computer system used in the experiment is: CPU Intel Core i9-13900KF (5.8GHz main frequency), memory size 32G, image processor NVIDIA RTX 4090. The operating system is Ubuntu 20.04.1 64bit. The programming environment is Python 3.8.18, Pytorch 1.12.0, cudatoolkit 11.6.

[0110] Simulation experiment results:

[0111] Figure 7 The training accuracy comparison diagram of the first data set is schematically shown, the horizontal axis of each coordinate system is the number of training rounds, the vertical axis is the training accuracy, recall rate, mAP_0.5, mAP_0.5:0.95, bounding box loss (train / box_loss), DFL loss (train / dfl_loss), category loss (train / als_loss), the blue line represents the original YOLOv8 model, the orange line represents the addition of C2F and DWR modules to the original YOLOv8 model, the green line represents the addition of C2F and SIMAM modules containing DWR to the original YOLOv8 model, and the red line represents the method of the present invention. According to the visualization results of the HRSC2016 data set training, it can be clearly seen that the accuracy and recall rate of the present invention are higher than the original YOLOv8 model throughout the training process, and the bounding box loss, category loss and DFL loss are also lower than the original YOLOv8 model throughout the training process. While the performance is improved, the model convergence rate is also faster than the original model. Therefore, it is proved that the improvement of this paper has been comprehensively optimized and improved on the basis of the original YOLOv8 model.

[0112] From the comparative experiments below, mAP50 in Table 1 and Table 2: When the IoU between the predicted box and the true box is greater than or equal to 0.5, the average accuracy of the model. mAP75: When the IoU between the predicted box and the true box is greater than or equal to 0.75, the average accuracy of the model. mAP50: 95: Indicates that the IoU threshold starts from 0.5 and increases to 0.95 in steps of 0.05. This indicator calculates the average of all mAP values ​​within this IoU threshold range. VOC07: The 11-point interpolation method is used to calculate the average precision (AP). In this method, the precision is interpolated at 11 fixed points (0.0, 0.1, 0.2, ..., 1.0) with a recall rate from 0 to 1. VOC12: A more accurate interpolation method, the all-point interpolation method, is used instead. This approach uses every possible recall value to calculate precision, rather than using 11 fixed points like VOC07. This approach is more granular and can provide more accurate AP calculations.

[0113] The following Tables 1 and 2 fully verify that the detection performance of the model of the present invention for small targets and dense targets is greatly improved, and in the three data sets, the two evaluation indicators AP75 and AP50-95 are much larger than the current R3Det, ​​S2ANet, KLD, Gliding Vertex, ROI TransFormer and KFIOU models, which proves the effectiveness of the improvement of this paper for small targets and dense targets.

[0114] Table 1 Comparative experiments on the HRSC2016 dataset

[0115]

[0116] Table 2 Comparative experiments on the FGSD dataset

[0117]

[0118] In order to verify the effectiveness of adding the LSKblock module to Backbone, improving C2f, and adding the SimAM attention mechanism to Neck, ablation experiments were performed on the HRSC and FGSD datasets to compare the detection performance, as shown in Tables 3 and 4:

[0119] Table 3 Ablation test on HRSC2016 dataset

[0120]

[0121] Table 4 Ablation test on FGSD dataset

[0122]

[0123] Through the data analysis of Table 3 and Table 4, all evaluation indicators have been improved in the HRSC2016 and FGSD datasets. At the same time, the SimAM attention mechanism is introduced in Neck, which effectively improves the detection accuracy of the model for dense targets, extremely small targets and difficult targets. mAP75 and mAP50-95 have been improved differently on the three datasets. Finally, the LSKblock module is introduced in Backbone to further improve the detection accuracy of the model. Finally, the improved model based on YOLOv8 has significantly improved the accuracy compared with the original YOLOv8 model on the three datasets of HRSC2016, FGSD and SDR9, and the model size has been reduced from 139.6MB to 131.8MB, a reduction of 5.59%. While improving the detection speed and detection accuracy, the computational overhead of model reasoning is reduced.

[0124] Based on the same inventive concept, as an implementation of the above-mentioned optical remote sensing image ship detection method based on YOLOv8, an embodiment of the present invention also provides an optical remote sensing image ship detection device based on YOLOv8. Figure 8 is a structural diagram of the device in the embodiment of the present invention, see Figure 8 As shown, the device may include:

[0125] A construction module 801 is used to construct an intelligent ship detection model, which includes a Backbone module and a Neck module of YOLOv8 in sequence. The Backbone module includes a large separation convolution kernel module and a channel-to-pixel module including a dilated residual submodule. The Neck module includes a parameter-free attention module.

[0126] A preprocessing module 802 is used to preprocess the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations, wherein the target format of the annotations is suitable for the intelligent ship detection model;

[0127] The training module 803 is used to sequentially input the multiple first ship images and the multiple second ship images preprocessed by the preprocessing module 802 into the intelligent ship detection model constructed by the construction module 801, train the intelligent ship detection model, and obtain a trained intelligent ship detection model;

[0128] The detection module 804 is used to input the predicted image into the intelligent ship detection model trained by the training module 803 to detect the predicted ship information;

[0129] The post-processing module 805 is used to post-process the predicted ship information detected by the detection module 804 to obtain a marked detection image.

[0130] Building module 801, the Backbone module in the intelligent ship detection model includes 2 convolution group modules, 1 channel to pixel module, 1 convolution group module, 1 channel to pixel module, 1 convolution group module, 1 channel to pixel module, 1 convolution group module, 1 channel to pixel module, 1 large separation convolution kernel module, and 1 fast spatial pyramid pooling module.

[0131] Building module 801, the channel-to-pixel module includes, in sequence, 1 convolution group module, 1 segmentation layer, n dilated residual submodules, 1 splicing layer and 1 convolution group module.

[0132] Building module 801, the Neck module includes, in sequence, 1 upsampling layer, 1 splicing layer, 1 channel-to-pixel module, 1 upsampling layer, 1 splicing layer, 1 channel-to-pixel module, 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, and 1 parameter-free attention module.

[0133] The detection module 804 is specifically used to input the predicted image into the Backbone module, output the first feature map, the second feature map and the third feature map, the resolution of the first feature map is greater than the resolution of the second feature map, and the resolution of the second feature map is greater than the resolution of the third feature map; input the first feature map, the second feature map and the third feature map into the Neck module, output the fourth feature map, the fifth feature map and the sixth feature map; input the output fourth feature map, the fifth feature map and the sixth feature map into a convolution group module and a common convolution module in sequence, and output the predicted ship information; the intelligent ship detection model also includes a Head module of YOLOv8, and the Head module includes a convolution group module and a common convolution module in sequence.

[0134] The detection module 804 inputs the predicted image into the Backbone module and outputs a first feature map, a second feature map and a third feature map, including: inputting the predicted image into two convolution group modules, one channel to pixel module, one convolution group module and one channel to pixel module in sequence, and outputting the first feature map; inputting the first feature map into one convolution group module and one channel to pixel module in sequence, and outputting the second feature map; inputting the second feature map into one convolution group module, one channel to pixel module, one large separation convolution kernel module and one fast spatial pyramid pooling module in sequence, and outputting the third feature map.

[0135] The detection module 804 inputs the first feature map, the second feature map and the third feature map into the Neck module, and outputs the fourth feature map, the fifth feature map and the sixth feature map, including: inputting the third feature map into an upsampling layer, outputting the first sampling feature map, and inputting the first sampling feature map and the second feature map into a splicing layer and a channel to the pixel module in sequence, and outputting the first intermediate feature map; inputting the first intermediate feature map into an upsampling layer, outputting the second sampling feature map, and inputting the second sampling feature map and the first feature map into a splicing layer and a channel to the image module in sequence; The fourth feature map is input into a convolution group module, outputs a second intermediate feature map, and the second intermediate feature map and the first intermediate feature map are sequentially input into a concatenation layer, a channel to pixel module, and a parameter-free attention module to output a fifth feature map; the fifth feature map is input into a convolution group module, outputs a third intermediate feature map, and the third intermediate feature map and the third feature map are sequentially input into a concatenation layer, a channel to pixel module, and a parameter-free attention module to output a sixth feature map.

[0136] The preprocessing module 802 is specifically used to cut the first data set and the second data set according to a preset overlap rate, respectively, to obtain a corresponding plurality of first cut images and a plurality of second cut images, each of which contains ships; convert the annotation format corresponding to each first cut image and each second cut image into a target format, to obtain a corresponding plurality of first conversion images and a plurality of second conversion images, the target format including ship categories; when the number of ship categories is greater than a preset value, the corresponding plurality of first conversion images and the plurality of second conversion images are respectively determined as a plurality of first ship images and a plurality of second ship images; when the number of ship categories is not greater than a preset value, the corresponding plurality of first conversion images and the plurality of second conversion images are expanded to obtain a plurality of first ship images and a plurality of second ship images.

[0137] The post-processing module 805 is specifically used to post-process the predicted ship information to obtain a detected image with annotations, including: screening the preset bounding box according to non-maximum suppression to obtain a target bounding box, the target bounding box includes the original coordinates; screening the preset category confidence according to a preset threshold to obtain the target category confidence; decoding the original coordinates into target coordinates; marking the rotation angle, target bounding box, target category confidence and target confidence in the predicted image to obtain a detected image with annotations; the predicted ship information includes the rotation angle, the preset bounding box, the preset category confidence and the target confidence.

[0138] It should be noted here that the above description of the embodiment of the optical remote sensing image ship detection device based on YOLOv8 is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiment of the optical remote sensing image ship detection device based on YOLOv8 of the embodiment of the present invention, please refer to the description of the method embodiment of the present invention for understanding.

[0139] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A ship detection method based on optical remote sensing images of YOLOv8, characterized in that: The ship target detection method comprises: Constructing an intelligent ship detection model, the intelligent ship detection model sequentially includes a Backbone module and a Neck module of YOLOv8, the Backbone module includes a large separation convolution kernel module, a channel to pixel module including a dilated residual submodule, and the Neck module includes a parameter-free attention module; Preprocessing the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations, wherein the target format of the annotations is suitable for the intelligent ship detection model; Inputting the plurality of first ship images and the plurality of second ship images into the intelligent ship detection model in sequence, training the intelligent ship detection model, and obtaining a trained intelligent ship detection model; Inputting the predicted image into the trained intelligent ship detection model to detect the predicted ship information; The predicted ship information is post-processed to obtain a marked detection image.

2. The optical remote sensing image ship detection method according to claim 1, characterized in that: The Backbone module includes, in sequence, 2 convolution group modules, 1 channel-to-pixel module, 1 convolution group module, 1 channel-to-pixel module, 1 convolution group module, 1 channel-to-pixel module, 1 convolution group module, 1 channel-to-pixel module, 1 large separation convolution kernel module, and 1 fast spatial pyramid pooling module.

3. The optical remote sensing image ship detection method according to claim 2, characterized in that: The channel-to-pixel module includes, in sequence, one convolution group module, one segmentation layer, n dilated residual submodules, one splicing layer and one convolution group module.

4. The optical remote sensing image ship detection method according to claim 2, characterized in that: The Neck module includes, in sequence, 1 upsampling layer, 1 splicing layer, 1 channel-to-pixel module, 1 upsampling layer, 1 splicing layer, 1 channel-to-pixel module, 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, 1 parameter-free attention module, 1 convolution group module, 1 splicing layer, 1 channel-to-pixel module, and 1 parameter-free attention module.

5. The optical remote sensing image ship detection method according to claim 4, characterized in that: The intelligent ship detection model further includes a Head module of YOLOv8, and the Head module includes a convolution group module and a common convolution module in sequence. The predicted image is input into the trained intelligent ship detection model to detect the predicted ship information, including: Inputting the predicted image into the Backbone module, outputting a first feature map, a second feature map, and a third feature map, wherein a resolution of the first feature map is greater than a resolution of the second feature map, and a resolution of the second feature map is greater than a resolution of the third feature map; Input the first feature map, the second feature map and the third feature map into the Neck module, and output a fourth feature map, a fifth feature map and a sixth feature map; The output fourth feature map, the fifth feature map and the sixth feature map are input into the one convolution group module and the one common convolution module in sequence to output the predicted ship information.

6. The optical remote sensing image ship detection method according to claim 5, characterized in that: The step of inputting the predicted image into the Backbone module and outputting a first feature map, a second feature map, and a third feature map comprises: Inputting the predicted image into two of the convolution group modules, one of the channel-to-pixel modules, one of the convolution group modules, and one of the channel-to-pixel modules in sequence, and outputting the first feature map; Input the first feature map into one of the convolution group modules and one of the channels into the pixel module in sequence, and output the second feature map; The second feature map is sequentially input into one of the convolution group modules, one of the channel to pixel modules, one of the large separation convolution kernel modules, and one fast spatial pyramid pooling module, and the third feature map is output.

7. The optical remote sensing image ship detection method according to claim 5, characterized in that: The step of inputting the first feature map, the second feature map, and the third feature map into the Neck module and outputting a fourth feature map, a fifth feature map, and a sixth feature map comprises: Input the third feature map into one of the upsampling layers, output a first sampling feature map, and input the first sampling feature map and the second feature map sequentially into one of the concatenated layers and one of the channels into a pixel module, and output a first intermediate feature map; Input the first intermediate feature map into one of the upsampling layers, output a second sampling feature map, and input the second sampling feature map and the first feature map into one of the concatenation layers, one of the channel-to-pixel modules, and one of the parameter-free attention modules in sequence, and output the fourth feature map; Input the fourth feature map into a convolution group module, output a second intermediate feature map, and input the second intermediate feature map and the first intermediate feature map into one of the concatenation layers, one of the channels to pixels module, and one of the parameter-free attention modules in sequence, and output the fifth feature map; The fifth feature map is input into a convolution group module to output a third intermediate feature map, and the third intermediate feature map and the third feature map are sequentially input into one of the splicing layers, one of the channel to pixel modules, and one of the parameter-free attention modules to output the sixth feature map.

8. The optical remote sensing image ship detection method according to claim 1, characterized in that: The preprocessing of the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations includes: According to a preset overlap rate, the first data set and the second data set are respectively cut to obtain a corresponding plurality of first cut images and a plurality of second cut images, each of the first cut images and each of the second cut images having a ship; Converting the annotation formats corresponding to the first cutting images and the second cutting images into the target format to obtain a corresponding plurality of first conversion images and a plurality of second conversion images, wherein the target format includes a ship category; When the number of the ship categories is greater than a preset value, determining the corresponding plurality of first conversion images and the plurality of second conversion images as the plurality of first ship images and the plurality of second ship images, respectively; When the number of the ship categories is not greater than a preset value, the corresponding plurality of first conversion images and the plurality of second conversion images are expanded to obtain the plurality of first ship images and the plurality of second ship images.

9. The optical remote sensing image ship detection method according to claim 1, characterized in that: The predicted ship information includes a rotation angle, a preset bounding box, a preset category confidence and a target confidence, and the post-processing of the predicted ship information to obtain a detection image with annotations includes: According to non-maximum suppression, the preset bounding box is screened to obtain a target bounding box, wherein the target bounding box includes original coordinates; The preset category confidence is screened according to a preset threshold to obtain a target category confidence; Decoding the original coordinates into target coordinates; The rotation angle, the target bounding box, the target category confidence and the target confidence are all marked in the predicted image to obtain the marked detection image.

10. An optical remote sensing image ship detection device based on YOLOv8, characterized in that: The optical remote sensing image ship detection device comprises: A construction module is used to construct an intelligent ship detection model, wherein the intelligent ship detection model includes a Backbone module and a Neck module of YOLOv8 in sequence, wherein the Backbone module includes a large separation convolution kernel module and a channel-to-pixel module including a dilated residual submodule, and the Neck module includes a parameter-free attention module; A preprocessing module, used to preprocess the first data set and the second data set respectively to obtain a corresponding plurality of first ship images with annotations and a plurality of second ship images with annotations, wherein the target format of the annotations is suitable for the intelligent ship detection model; A training module, used for sequentially inputting the plurality of first ship images and the plurality of second ship images into the intelligent ship detection model, training the intelligent ship detection model, and obtaining a trained intelligent ship detection model; A detection module, used for inputting the predicted image into the trained intelligent ship detection model to detect the predicted ship information; The post-processing module is used to post-process the predicted ship information to obtain a marked detection image.

Citation Information

Patent Citations

  • Visible light remote sensing image ship target detection method

    CN116109942A

  • Marine ship detection method based on synthetic aperture radar data

    CN116665148A

  • KR20230053347A

Cited By

  • Rapid ship classification and identification method for overwater checkpoint

    CN119169387A

  • Metal particle detection method and system under complex background and medium

    CN119205727A

  • YOLOv8 algorithm-based ship detection model training method and ship detection method

    CN119360320A

  • Multi-source information small target ship identification and abnormity study and judgment method and device

    CN119600552A