A Single-Stage Rotating Ship Detection Method Based on Fully Convolutional Networks
The single-stage rotating ship detection method through the fully convolutional network solves the problems of low accuracy and low efficiency of remote sensing rotating frame detection, and achieves efficient ship target detection, especially in maritime ship detection, which improves detection Speed and precision.
Patent Information
- Application Number
- CN202210198503.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-03-02
AI Technical Summary
The problem of low accuracy and low efficiency of remote sensing rotating frame detection in the existing technology, especially in the detection of maritime ship targets, is that the traditional method of using an anchor frame design with a rotation angle improves the detection accuracy but leads to a decrease in detection speed.
A single-stage rotating ship detection method based on a fully convolutional network is adopted. By building a model including a backbone network and a detection network, a single-layer full convolution operation is used to predict the target position, rotation deflection angle and category confidence, and a category loss is defined. , the loss function of regression loss and centrality loss avoids complex anchor frame design and improves detection efficiency.
It improves the efficiency and accuracy of ship detection, reduces memory consumption, enhances detection speed, and avoids the large amount of calculation problems caused by candidate frame regression and screening operations in dual-stage detection technology.
Smart Images

Figure CN114565824B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing technology and relates to a remote sensing image ship detection method, and specifically to a remote sensing image rotating ship target detection method based on deep learning, which can be used in the fields of maritime monitoring, coastal defense early warning, and marine rights protection. Background Art
[0002] The development of remote sensing technology has greatly helped people understand and explore the world. It has many distinctive technical features, such as wide data range, short acquisition cycle, and strong data comprehensiveness. In recent years, the "Gaofen" series of satellites have provided a large amount of high-resolution visible light remote sensing image data, which has brought opportunities and challenges to the development of my country's agriculture, ocean, meteorology, military and other fields. Among them, remote sensing rotating target detection provides a new idea for the practical application of remote sensing data. Remote sensing rotating target detection means that the bounding box of the target contains not only the center point position and length and width of the horizontal bounding box, but also the offset angle annotation. Rotating target detection in remote sensing images is more challenging than horizontal bounding box detection. Due to the difference in shooting angles, the target objects in remote sensing aerial images are different from those in natural images. Their arrangement direction is arbitrary and not perpendicular to the ground, and they are small in size and densely arranged, such as remote sensing targets such as aircraft, ships, and containers. At this time, the horizontal bounding box is not ideal for fitting the shape of the target. Using a rotating bounding box can better annotate the object. Especially for maritime ship targets, due to the differences in the length-width ratios of ships, the rotating bounding box can more accurately select the ship targets, thereby further accurately identifying the ship target category and judging the ship's direction of travel; at the same time, for port scenes, the rotating bounding box has better recognition accuracy and recall rate for densely arranged ship targets near the shore than the horizontal bounding box.
[0003] Compared with traditional target detection methods, deep learning-based methods have the characteristics of high precision, high accuracy, and end-to-end training and testing, and are currently the mainstream remote sensing target detection methods. Target detection methods based on deep learning include single-stage target detection methods and two-stage target detection methods. Among them, two-stage target detection methods such as Faster-RCNN perform feature extraction and screen a certain number of candidate frames in the first stage, and perform fine regression and screening on the candidate frames generated in the first stage in the second stage, and finally obtain the detection results. The two-stage model has high detection accuracy, but at the same time loses the detection speed to a certain extent; single-stage target detection methods such as YOLOv3 subtract the step of fine regression of candidate frames in the second stage, and directly regress and classify targets through feature points, which makes the detection model have a huge improvement in detection speed, and is more lightweight than the two-stage model, and more convenient for actual deployment and application. At the same time, the design of detectors without anchor frames is a new development trend. For example, FCOS is an idea to get rid of the anchor frame mechanism, converting the target detection task into the estimation of key points, effectively saving computing memory consumption, and improving the detection effect of small targets to a certain extent.
[0004] In order to detect rotating ship targets more accurately, researchers often start from the two perspectives of feature extraction and loss function. For example, the patent application with application publication number CN112395969A, entitled "A method for detecting rotating ships in remote sensing images based on feature pyramid", discloses a two-stage rotating target detection method based on convolutional neural network. The invention uses convolutional neural network for two-stage target detection, and uses convolutional neural network with stronger feature extraction ability to extract features; feature pyramid is used for multi-scale detection; the key is to directly use the rotating frame to detect ship targets in different directions. This method solves the problems of insufficient feature extraction ability of traditional methods and the special characteristics of ships in multiple directions, different sizes, and dense distribution. However, this method uses the anchor frame design of the rotation angle, and each feature point contains 84 anchor frames, which improves the detection accuracy to a certain extent, but leads to a certain loss in detection speed. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and propose a single-stage rotating ship detection method based on a fully convolutional network to solve the technical problems of low accuracy and low efficiency of remote sensing rotating frame detection in the prior art.
[0006] To achieve the above object, the technical solution adopted by the present invention includes the following steps:
[0007] (1) Obtain training sample set and test sample set:
[0008] (1a) Obtain M optical remote sensing ship images containing ship targets, and perform rotating frame annotation on the ship targets in each optical remote sensing ship image. Then, normalize the size of each optical remote sensing ship image after the ship targets are annotated. Then, perform color standardization on the normalized images to obtain T preprocessed optical remote sensing ship images H = {H 1 ,H 2 ,…,H m ,…,H M}, where M ≥ 1000, H m represents the t-th preprocessed optical remote sensing ship image, W and R represent the number of pixels in the rows and columns of the image;
[0009] (1b) For each preprocessed optical remote sensing ship image H m Data enhancement is performed, and the Q preprocessed optical remote sensing ship images in H and their corresponding data enhanced optical remote sensing ship images form a training sample set H train The remaining Y preprocessed optical remote sensing ship images and their corresponding data enhanced optical remote sensing ship images form a test sample set H test ,in M = Q + Y;
[0010] (2) Construct a single-stage rotating ship target detection model O based on a fully convolutional network:
[0011] (2a) Construct the structure of a single-stage rotating ship target detection model O based on a fully convolutional network:
[0012] A single-stage rotating ship target detection model O including a backbone network and a detection network connected in sequence is constructed, wherein: the backbone network includes a feature extraction subnetwork and a feature enhancement subnetwork connected in sequence; the feature enhancement subnetwork includes three feature enhancement layers arranged in parallel; the detection network includes a detection subnetwork connected to each feature enhancement layer, each detection subnetwork includes a first full convolutional network and a second full convolutional network arranged in parallel and each consisting of a plurality of first full convolutional layers; the output end of the first full convolutional network is connected to a second full convolutional layer, a third full convolutional layer and a fourth full convolutional layer arranged in parallel; the output end of the second full convolutional network is connected to a fifth full convolutional layer;
[0013] (2b) Define the loss function L of the single-stage rotating ship target detection model O:
[0014] L=L cls +αL reg +βL C
[0015]
[0016]
[0017]
[0018] Among them, x and y represent the horizontal and vertical coordinates of the feature point respectively, L cls represents the category loss function, L reg represents the regression loss function, L c represents the centrality loss function, p x,y is the feature point prediction category output, is the category label, t x,y is the feature point prediction regression output, Regression label, N pos Indicates the number of generated prediction targets, Indicates the indicator, when hour, Take 1, when hour, Take 0, α and β as weight parameters, α+β=1, and the value range is [0,1];
[0019] (3) Iterative training of the single-stage rotating ship detection model based on the fully convolutional network:
[0020] (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 10000, and the single-stage rotating ship detection model of the tth iteration is O t , the weights of the t-th iteration detection network and feature extraction sub-network are ω 1t ,ω 2t , and let O t =O, t=1;
[0021] (3b) predict the position, rotation angle, center offset and category confidence of each target;
[0022] (3b1) will be from the training sample set H train b training samples randomly selected from the dataset are used as the single-stage rotating ship detection model O t The feature extraction subnetwork in the backbone network extracts the multi-scale feature map of the target in each training sample; the feature enhancement subnetwork performs feature enhancement on each feature map, b≥8;
[0023] (3b2) The first and second fully convolutional networks in the detection network perform multi-layer full convolution operations on each feature map after feature enhancement, and the second, third, and fourth fully convolutional layers perform single-layer full convolution operations on each regression feature map obtained by the multi-layer full convolution operation of the first fully convolutional network to obtain the position label of the predicted target. Angle Label Centrality Label The fifth full convolution layer performs a single-layer full convolution operation on each classification feature map obtained by the multi-layer full convolution operation of the second full convolution network to obtain the category confidence label of the predicted target
[0024] (3c) Using the loss function L, and passing and Calculate O t The loss value L t , using the back propagation method, through L t Calculate O t The parameter gradient λ t , and then use the gradient descent method to pass λ t The weights ω of the detection network and feature extraction sub-network 1t and ω 2t Make updates;
[0025] (3d) Determine whether t=T holds. If so, obtain the trained single-stage rotating ship detection network model O*. Otherwise, set t=t+1 and execute step (3b);
[0026] (4) Obtain the detection results of a single-stage rotating ship:
[0027] The test sample set H test As the input of the trained single-stage rotating ship detection model O*, forward propagation is performed to obtain the position label of the predicted target Angle Label Centrality Label Class confidence labels The rotation non-maximum suppression method NMS with a threshold of μ is used to predict the target Screening to obtain H test Contains the bounding box and class confidence of each object.
[0028] Compared with the prior art, the present invention has the following advantages:
[0029] 1. In the process of training the single-stage rotating ship detection network model and obtaining the detection results of the single-stage rotating ship, the first full convolution network and the second full convolution network can obtain the position label, angle label, center label and classification confidence label of the predicted target through a single-layer full convolution operation. This avoids the influence of the complex process of obtaining these parameters by the anchor frame method of rotating angle in the prior art on the detection speed, and effectively improves the efficiency of detecting ships with larger length and width ratios.
[0030] 2. The present invention uses a fully convolutional network in the detection network. The height and width of the intermediate layer feature map are converted back to the size of the input feature map through the transposed convolution layer of each layer feature map obtained by the backbone network, so that the prediction result has the same spatial height and width as the input feature map. Figure 1 One-to-one correspondence directly predicts the target pixel by pixel, avoiding the defect of large amount of computation caused by the existing two-stage target detection technology that generates candidate boxes in the first stage and regresses and screens the candidate boxes in the second stage, reducing memory consumption and thus improving detection speed.
[0031] 3. The loss function of the present invention includes a center offset loss, which calculates the offset between the center of the candidate box and the corresponding feature point, reduces the weight of the predicted box with a large center point offset, and avoids the generation of a large number of low-quality candidate boxes due to the fact that the predicted center point is far away from the feature point compared to the traditional single-stage target detection model; at the same time, the loss function performs a weighted calculation on the angle offset and position offset obtained by different full convolution branches, which makes the training easier to converge to a certain extent, and also improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart for realizing the present invention;
[0033] Figure 2 This is a schematic diagram of the structure of a single-stage rotating ship target detection model constructed by the present invention;
[0034] Figure 3 It is a schematic diagram of the remote sensing rotating frame annotation of the present invention;
[0035] Figure 4 This is a diagram showing the detection results of a remote sensing visible light image according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0037] Reference Figure 1 , the present invention comprises the following steps:
[0038] Step 1) Obtain training sample set and test sample set:
[0039] (1a) Obtain M optical remote sensing ship images containing ship targets, and perform rotating frame annotation on the ship targets in each optical remote sensing ship image. Then, normalize the size of each optical remote sensing ship image after the ship targets are annotated. Then, perform color standardization on the normalized images to obtain T preprocessed optical remote sensing ship images H = {H 1 ,H 2 ,…,H m,…,H M}, where M ≥ 1000, H m represents the t-th preprocessed optical remote sensing ship image, W and R represent the number of pixels in the rows and columns of the image;
[0040] Spin box annotation format reference Figure 3 , the annotation method is to use the horizontal coordinate x and vertical coordinate y of the center of the rotating annotation box, the length l and width w of the rotating annotation box, and the counterclockwise angle θ between the long side of the rotating annotation box and the horizontal direction as the bounding box position label of each rotating target; since the sizes of the remote sensing visible light images obtained are different, a size normalization operation is used to unify the images to a uniform size to facilitate unified training and annotation of the network, and then the rgb three channels are converted into bgr channels due to the network input requirements, and then a standardization operation is performed. The purpose of these two steps is to convert the image size and color channel to meet the input requirements of the network, and convergence in the training process is easier. In this embodiment, the RoLabelImg annotation software is used to annotate the ship targets of the visible light remote sensing dataset, W=1024, H=1024, M=1102;
[0041] (1b) For each preprocessed optical remote sensing ship image H m Data enhancement is performed, and the Q preprocessed optical remote sensing ship images in H and their corresponding data enhanced optical remote sensing ship images form a training sample set H train The remaining Y preprocessed optical remote sensing ship images and their corresponding data enhanced optical remote sensing ship images form a test sample set H test ,in M = Q + Y;
[0042] The data set is expanded by data enhancement to avoid overfitting. In this example, the data enhancement method is to randomly select one or more of the rotation enhancement, flip enhancement, scaling enhancement, and noise enhancement methods with a probability of 0.5. In this embodiment, Q=802, Y=300;
[0043] Step 2) Construct a single-stage rotating ship target detection model based on a fully convolutional network.
[0044] (2a) Construct a single-stage rotating ship target detection model O based on a fully convolutional network, whose structure is shown in Figure 2;
[0045] A single-stage rotating ship target detection model O is constructed, which includes a backbone network and a detection network connected in sequence, wherein: the backbone network includes a feature extraction subnetwork and a feature enhancement subnetwork connected in sequence; the detection network includes a first full convolutional network and a second full convolutional network arranged in parallel and each consisting of a plurality of first full convolutional layers; the output end of the first full convolutional network is connected to a second full convolutional layer, a third full convolutional layer and a fourth full convolutional layer arranged in parallel; the output end of the second full convolutional network is connected to a fifth full convolutional layer;
[0046] The feature extraction subnetwork in the backbone network includes a first convolutional layer, a maximum pooling layer, and four blocks connected in sequence; the feature enhancement subnetwork includes three feature enhancement layers connected in sequence, and the first feature enhancement layer, the second feature enhancement layer, and the third feature enhancement layer are respectively connected to the second block, the third block, and the fourth block in the feature extraction subnetwork;
[0047] The specific parameters of the feature extraction subnetwork are as follows: the convolution kernel size of the first convolution layer is 7*7, the convolution kernel step size is 2, and the number of convolution kernels is 64; the first block contains 3 first convolution blocks connected in sequence, the first convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 64, the convolution kernel size of the first and third convolution layers is 1*1, and the number of convolution kernels of the third convolution layer is 128; the second block contains 4 second convolution blocks connected in sequence, the second convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 128, the convolution kernel size of the first and third convolution layers is 1*1, and the number of convolution kernels of the third convolution layer is 256; the third block The block contains 6 third convolution blocks connected in sequence, the third convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 256, the convolution kernel sizes of the first and third convolution layers are 1*1, and the number of convolution kernels of the third convolution layer is 512; the fourth block contains 3 fourth convolution blocks connected in sequence, the fourth convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 512, the convolution kernel sizes of the first and third convolution layers are 1*1, and the number of convolution kernels of the third convolution layer is 1024;
[0048] The first full convolutional network and the second full convolutional network in the detection network both contain 4 first full convolutional layers. The specific parameters of the detection network are: the convolution kernel size of the first full convolutional layer is 3×3 and the number of channels is 256; the convolution kernel size of the second full convolutional layer is 3×3 and the number of channels is 4; the convolution kernel size of the third full convolutional layer is 3×3 and the number of channels is 1; the convolution kernel size of the fifth full convolutional layer of the second full convolutional network is 3×3 and the number of channels is L; where L represents the number of detection categories.
[0049] (2b) Define the loss function L of the single-stage rotating ship target detection model O:
[0050] L=L cls +αL reg +βL C
[0051]
[0052]
[0053]
[0054] Among them, L cls represents the category loss function, L reg represents the regression loss function, L c represents the centrality loss function, f focalloss represents the focalloss loss function, f GIoU represents the GIoU loss function, f centerness represents the centerness loss function, p x,y is the feature point prediction category output, is the category label, t x,y is the feature point prediction regression output, Regression label, N pos Indicates the number of generated prediction targets, Indicates the indicator, when hour, Take 1, when hour, Take 0, α and β as weight parameters, α+β=1, and the value range is [0,1]; category loss function f focalloss , regression loss function f GIoU , center loss function f centerness The specific formulas are:
[0055] f focalloss =-(1-p t ) γ log(p t )
[0056]
[0057]
[0058] where p t represents the confidence of the generated label, γ is a hyperparameter, taking [0,5], A p Represents the area of the candidate box generated by the feature point, A grepresents the real box selection area containing the feature point, and I represents A p With A g The overlapping area, l*, t*, r*, b* represent the distance from the center point to the left, top, right, and bottom of the regression box label respectively;
[0059] The present invention is a rotation frame target detection. Compared with the horizontal frame detection, the rotation frame detection introduces an angle branch and normalizes it in a weighted manner; the focal loss loss is used as the classification loss function to solve the problem of sample imbalance; the regression loss uses the GIoU loss to calculate the intersection and union ratio between the predicted frame and the real label frame. Compared with the traditional IoU loss and smoothL1 loss, the GIoU loss not only focuses on the overlapping area, but also focuses on other non-overlapping areas, which can more accurately reflect the specific location information of targets with large aspect ratios such as ships; the centerness offset loss is introduced to calculate the offset between the feature point and the center point of the real label, so that the edge targets can be filtered during the training process, the convergence speed is accelerated, and the quality of the generated candidate frame is improved. In this embodiment, α=1 / 5, β=4 / 5, γ=2;
[0060] Step 3) Iteratively train the single-stage rotating ship detection model based on the fully convolutional network:
[0061] (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 10000, and the single-stage rotating ship detection model of the tth iteration is O t , the weights of the t-th iteration detection network and feature extraction sub-network are ω 1t ,ω 2t , and let O t =O, t=1;
[0062] In this embodiment, T=30000 to ensure that the network training is more sufficient;
[0063] (3b) predict the position, rotation angle, center offset and category confidence of each target;
[0064] (3b1) will be from the training sample set H train b training samples randomly selected from the dataset are used as the single-stage rotating ship detection model O t The feature extraction subnetwork in the backbone network extracts multi-scale feature maps of the target in each training sample. The feature extraction subnetwork performs feature enhancement on each feature map, b≥8.
[0065] The feature extraction subnetwork extracts features from the input image to obtain multi-level feature maps with different downsampling degrees; in the process of network forward propagation, the feature maps generated by convolution of the 2nd block, 3rd block and 4th block of the feature enhancement network are convolved with 1×1 convolution kernels to obtain the corresponding first feature enhancement layer, second feature enhancement layer and third feature enhancement layer; the third feature enhancement layer obtains a feature map of the same size as the second feature layer by upsampling and adds it to the feature map, and the second feature enhancement layer obtains a feature map of the same size as the first feature layer by upsampling and adds it to the feature map, thereby achieving the effect of feature fusion, the feature semantic information of the low-level feature map is relatively small, but the target position is accurate; the semantic information of the high-level feature map is relatively rich, but the target position is relatively rough, and the feature fusion operation of the feature enhancement subnetwork makes different feature layers have strong semantic features; in this embodiment, b=8, and the design of b=8 is limited by the video memory of the experimental equipment. The maximum number of training samples for each iteration can only be set to 8, otherwise it exceeds the memory;
[0066] (3b2) The first full convolution network and the second full convolution network in the detection network perform multi-layer full convolution operations on each feature map after feature enhancement, and the second full convolution layer, the third full convolution layer, and the fourth full convolution layer perform single-layer full convolution operations on each regression feature map obtained by the multi-layer full convolution operation of the first full convolution network to obtain the position label. Angle Label Centrality Label The fifth fully convolutional layer performs a full convolution operation on each classification feature map obtained by the multi-layer full convolution operation of the second fully convolutional network to obtain the category confidence label of the predicted target
[0067] The fourth full convolutional layer for calculating the center offset is connected to the first full convolutional network instead of the second full convolutional network, so that it shares the same first full convolutional network with the second full convolutional layer for obtaining the position label of the regression candidate box and the third full convolutional layer for obtaining the deflection angle label of the regression candidate box, thereby obtaining richer position information and making the calculated center point offset more accurate.
[0068] (3c) Using the loss function L, and passing and Calculate O t The loss value L t , using the back propagation method, through L t Calculate O t The parameter gradient λ t , and then use the gradient descent method to pass λ t The weights ω of the detection network and feature extraction sub-network 1t and ω 2t Make updates;
[0069] The weight update formula in step 3c) is as follows:
[0070]
[0071]
[0072] Where η represents the learning step size, 0.0001≤η≤0.1, ω 2t ′ and ω 1t Respectively represent ω 1t and ω 2t The updated results, Indicates partial derivative calculation. In this embodiment, the optimizer function uses stochastic gradient descent SGD. The learning rate is decayed when the network iterates to a certain number of times in order to prevent the loss function from falling into a local minimum. The initial learning rate η=0.01. When the network iterates to the 10,000th time, the learning rate η=0.001. When the network iterates to the 20,000th time, the learning rate η=0.0001.
[0073] (3d) Determine whether t=T holds. If so, obtain the trained single-stage rotating ship detection network model O*. Otherwise, set t=t+1 and execute step (3b);
[0074] Step 4) Obtain the detection results of the single-stage rotating ship:
[0075] The test sample set H test As the input of the trained single-stage rotating ship detection model O*, forward propagation is performed to obtain the position label of the predicted target Angle Label Centrality Label Class confidence labels The rotation non-maximum suppression method NMS with a threshold of μ is used to predict the target Screening to obtain H test The bounding box and category confidence of each target are included. The detection results of each image in the test set are output, and the results are as follows Figure 4 As shown,
[0076] The test results are shown in the figure below: Figure 4 (a) with Figure 4 (b) Figure 4 (a) with Figure 4 (b) are all ship detection results of remote sensing images. The ship targets are detected using a rotating frame, and the classification labels and confidence levels of the corresponding targets are marked; in this embodiment, μ=0.5.
[0077] The following experiments are used to further illustrate the technical effects of the present invention:
[0078] 1. Simulation conditions and contents:
[0079] The simulation platform for this experiment is Intel Xeon CPU E5-2680 v3, with a processor frequency of 2.50GHz, a memory of 128GB, and a graphics card of NVIDIA GTX TITAN V. The operating system is Ubuntu 18.04. The software platform is python 3.8.11 and pytorch 1.7.0 to build and train the neural network model, and Nvidia Cuda 10.1 and Cudnn v8 are used for acceleration.
[0080] The target detection evaluation index used in the simulation is mAP (Mean Average Precision), AP of each type of detection, and FPS. This evaluation index is the main evaluation index in the field of target detection and is a comprehensive index that can reflect the performance of all aspects of the algorithm. AP (Average Precision) represents the average precision under different recall rates. Here, precision refers to the ratio of the number of correctly detected samples to the total number of detections, and recall refers to the ratio of the number of correctly detected samples to the number of true value samples. mAP is the average AP of all categories. There are two ways to calculate AP: The first is the calculation method of PASCAL VOC CHALLENGE before 2010. First, a set of thresholds [0, 0.1, 0.2, …, 1] is set. Then, for each recall greater than each threshold, a corresponding maximum precision will be obtained, so 11 precisions are calculated. AP is the average of these 11 precisions. This method is called 11-point interpolated average precision. The second method is the calculation method improved by PASCAL VOC CHALLENGE since 2010. The new calculation method assumes that there are M positive examples in N samples, then M recall values [1 / M, 2 / M, ..., M / M] will be obtained. For each recall value r, the corresponding maximum precision (r'>=r) can be calculated, and then the M precision values are averaged to get the final AP value. The AP in this article is calculated using the second standard. For the target detection task, the intersection and union ratio of all predicted bounding boxes judged as targets and GT (Ground Truth) is calculated. If the intersection and union ratio is greater than the set threshold of 0.5, it is judged as a correct detection result. In addition, FPS (Frames Per Second) represents the number of pictures detected by the model per second, which is obtained by dividing the total number of detected pictures by the total detection time, and is used to describe the detection speed of the model.
[0081] The simulation uses existing single-stage and double-stage rotating frame object detection networks: including RoI-Transformer, Faster R-CNN with added angle branch, Retinanet with added angle branch, and oriented R-CNN for comparative experiments. The network of the present invention is trained with the HRSC2016 dataset and compared with the existing rotating frame object detection networks such as RoITrans, Faster r-cnn-R, and retinanet-R, and the accuracy mAP and inference speed FPS are compared respectively.
[0082] The detection efficiency and detection accuracy of the present invention and the prior art are simulated respectively, and the results are shown in Table 1.
[0083] 2. Analysis of simulation results:
[0084] Table 1
[0085] Detection Methods mAP FPS Faster R-CNN 74.43 15.9 Retinanet R 69.21 18.4 RoI trans 90.13 13.3 Oriented R-CNN 89.94 13.8 FCR-det 89.27 16.8
[0086] It can be seen from Table 1 that without losing detection accuracy, the detection speed can be significantly improved by using the method proposed in the present invention. The detection speed is significantly improved compared to the two-stage target detection module, so it is easier to deploy on various mobile terminals.
Claims
1. A single-stage rotating ship detection method based on a fully convolutional network, characterized in that: The steps include: (1) Obtain training sample set and test sample set: (1a) Obtain M optical remote sensing ship images containing ship targets, and perform rotating frame annotation on the ship targets in each optical remote sensing ship image. Then, each optical remote sensing ship image after the ship targets are annotated is normalized in size, and then the normalized image is color standardized to obtain T preprocessed optical remote sensing ship images H = {H1, H2, ..., H m ,…,H M }, where M ≥ 1000, H m represents the t-th preprocessed optical remote sensing ship image, W and R represent the number of pixels in the rows and columns of the image; (1b) For each preprocessed optical remote sensing ship image H m Data enhancement is performed, and the Q preprocessed optical remote sensing ship images in H and their corresponding data enhanced optical remote sensing ship images form a training sample set H train The remaining Y preprocessed optical remote sensing ship images and their corresponding data enhanced optical remote sensing ship images form a test sample set H test ,in M = Q + Y; (2) Construct a single-stage rotating ship target detection model O based on a fully convolutional network: (2a) Construct the structure of a single-stage rotating ship target detection model O based on a fully convolutional network: A single-stage rotating ship target detection model O including a backbone network and a detection network connected in sequence is constructed, wherein: the backbone network includes a feature extraction subnetwork and a feature enhancement subnetwork connected in sequence; the feature enhancement subnetwork includes three feature enhancement layers arranged in parallel; the detection network includes a detection subnetwork connected to each feature enhancement layer, each detection subnetwork includes a first full convolutional network and a second full convolutional network arranged in parallel and each consisting of a plurality of first full convolutional layers; the output end of the first full convolutional network is connected to a second full convolutional layer, a third full convolutional layer and a fourth full convolutional layer arranged in parallel; the output end of the second full convolutional network is connected to a fifth full convolutional layer; (2b) Define the loss function L and category loss function L of the single-stage rotating ship target detection model O cls , regression loss function L reg , center loss function L c : L=L cls +αL reg +βL C Among them, p x,y is the feature point prediction category output, is the category label, t x,y is the feature point prediction regression output, Regression labels, Indicates the indicator, when hour, Take 1, when hour, Take 0, α and β as weight parameters, α+β=1, and the value range is [0,1]; (3) Iterative training of the single-stage rotating ship detection model based on the fully convolutional network: (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 10000, and the single-stage rotating ship detection model of the tth iteration is O t , the weights of the t-th iteration detection network and feature extraction sub-network are ω 1t ,ω 2t , and let O t =O, t=1; (3b) predict the position, rotation angle, center offset and category confidence of each target; (3b1) will be from the training sample set H train b training samples randomly selected from the dataset are used as the single-stage rotating ship detection model O t The feature extraction subnetwork in the backbone network extracts the multi-scale feature map of the target in each training sample; the feature enhancement subnetwork enhances the features of each feature map, b≥8; (3b2) The first full convolution network and the second full convolution network in the detection network perform multi-layer full convolution operations on each feature map after feature enhancement, and the second full convolution layer, the third full convolution layer, and the fourth full convolution layer perform single-layer full convolution operations on each regression feature map obtained by the multi-layer full convolution operation of the first full convolution network to obtain the position label. Angle Label Centrality Label The fifth fully convolutional layer performs a full convolution operation on each classification feature map obtained by the multi-layer full convolution operation of the second fully convolutional network to obtain the category confidence label of the predicted target (3c) Using the loss function L, and passing and Calculate O t The loss value L t , using the back propagation method, through L t Calculate O t The parameter gradient λ t , and then use the gradient descent method to pass λ t The weights ω of the detection network and feature extraction sub-network 1t and ω 2t Make updates; (3d) Determine whether t=T holds. If so, obtain the trained single-stage rotating ship detection network model O*. Otherwise, set t=t+1 and execute step (3b); (4) Obtain the detection results of a single-stage rotating ship: The test sample set H test As the input of the trained single-stage rotating ship detection model O*, forward propagation is performed to obtain the position label of the predicted target Angle Label Centrality Label Class confidence labels The rotation non-maximum suppression method NMS with a threshold of μ is used to predict the target Screening to obtain H test Contains the bounding box and class confidence of each object.
2. According to claim 1, the single-stage rotating ship detection method based on a fully convolutional network is characterized in that: The rotating frame annotation of the ship target in each optical remote sensing ship image described in step (1a) is implemented by: using the horizontal coordinate x and vertical coordinate y of the center of the rotating annotation frame, the length l and width w of the rotating annotation frame, and the counterclockwise angle θ between the long side of the rotating annotation frame and the horizontal direction as the bounding box position label of each rotating target.
3. According to claim 1, the single-stage rotating ship detection method based on a fully convolutional network is characterized in that: The step (1b) is to process each pre-processed optical remote sensing ship image H t Perform data enhancement by using rotation enhancement, flip enhancement, scaling enhancement or noise enhancement methods.
4. According to claim 1, the single-stage rotating ship detection method based on a fully convolutional network is characterized in that: The single-stage rotating ship target detection model O described in step (2a), wherein: The feature extraction subnetwork in the backbone network includes a first convolutional layer, a maximum pooling layer, and four blocks connected in sequence; the feature enhancement subnetwork includes three feature enhancement layers connected in sequence, and the first feature enhancement layer, the second feature enhancement layer, and the third feature enhancement layer are respectively connected to the second block, the third block, and the fourth block in the feature extraction subnetwork; The specific parameters of the feature extraction subnetwork are as follows: the convolution kernel size of the first convolution layer is 7*7, the convolution kernel step size is 2, and the number of convolution kernels is 64; the first block contains 3 first convolution blocks connected in sequence, the first convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 64, the convolution kernel size of the first and third convolution layers is 1*1, and the number of convolution kernels of the third convolution layer is 128; the second block contains 4 second convolution blocks connected in sequence, the second convolution block contains 2 convolution layers, the number of convolution kernels of the first and second convolution layers is 128, and the convolution kernel size of the first and third convolution layers is 1*1, and the number of convolution kernels in the third convolution layer is 256; the third block contains 6 third convolution blocks connected in sequence, the third convolution block contains 2 convolution layers, the number of convolution kernels in the first convolution layer and the second convolution layer are both 256, the convolution kernel sizes of the first convolution layer and the third convolution layer are both 1*1, and the number of convolution kernels in the third convolution layer is 512; the fourth block contains 3 fourth convolution blocks connected in sequence, the fourth convolution block contains 2 convolution layers, the number of convolution kernels in the first convolution layer and the second convolution layer are both 512, the convolution kernel sizes of the first convolution layer and the third convolution layer are both 1*1, and the number of convolution kernels in the third convolution layer is 1024; The first full convolutional network and the second full convolutional network in the detection network both contain 4 first full convolutional layers. The specific parameters of the detection network are: the convolution kernel size of the first full convolutional layer is 3×3 and the number of channels is 256; the convolution kernel size of the second full convolutional layer is 3×3 and the number of channels is 4; the convolution kernel size of the third full convolutional layer is 3×3 and the number of channels is 1; the convolution kernel size of the fifth full convolutional layer of the second full convolutional network is 3×3 and the number of channels is L; where L represents the number of detection categories.
5. The single-stage rotating ship detection method based on a fully convolutional network according to claim 1 is characterized in that: The loss function L of the single-stage rotation ship target detection model O described in step (2b) and the category loss function L reg , regression loss function L reg , center loss function L c , the specific loss function formulas used are: f focalloss =-(1-p t ) γ log(p t ) where f focalloss represents the focal loss function, f GIoU represents the GIoU loss function, L c represents the centerness loss function; p t represents the confidence of the generated label, γ is a hyperparameter, taking [0,5], A p Represents the area of the candidate box generated by the feature point, A g represents the real box selection area containing the feature point, and I represents A p With A g The overlapping area, l*, t*, r*, and b* represent the distance from the center point to the left, top, right, and bottom of the regression box label, respectively.
6. The single-stage rotating ship detection method based on a fully convolutional network according to claim 1 is characterized in that: The weights of the t-th iteration detection network and feature extraction subnetwork described in step (3a) are ω 1 With ω 2 , where ω 1 Use the network weights trained on ImageNet Initialize, ω 2 Use He initialization method for initialization.
7. The single-stage rotating ship detection method based on a fully convolutional network according to claim 1 is characterized in that: The weights ω of the detection network and feature extraction subnetwork in step (3c) 1t and ω 2t The update formulas are: Where η represents the learning step size, 0.0001≤η≤0.1, ω 2t ′ and ω 1t Respectively represent ω 1t and ω 2t The updated results, Represents partial derivative calculation.
