A method for ship target detection in remote sensing images based on convolutional neural networks
By improving the RetinaNet network and combining it with a feature pyramid network and an orientation-invariant model, the problems of densely packed, oriented, and complex backgrounds in ship target detection in remote sensing images were solved, achieving high-precision and efficient ship target detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-08
- Publication Date
- 2026-03-10
AI Technical Summary
Existing methods for detecting ship targets in remote sensing images suffer from low detection accuracy, high computational load, slow speed, and discontinuous angle regression when faced with densely packed targets, variable orientations, and complex backgrounds.
An improved RetinaNet network is adopted, which combines ResNet50 residual network, Feature Pyramid Network (FPN), Coordinate Attention Module, Active Rotation Filter (ARF), and Oriented Response Pooling (ORPooling) to construct an orientation-invariant model. This model is trained using Focal Loss and KLD Loss to achieve high-precision detection of ship targets.
It improves the accuracy and speed of ship target detection, enabling accurate positioning of ship targets in any direction under complex backgrounds. It solves the problems of low detection accuracy and high computational load in traditional methods, and enhances the network's adaptability to targets.
Smart Images

Figure CN116563726B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of remote sensing image target detection, in particular, especially relates to a remote sensing image ship target detection method based on a convolutional neural network. BACKGROUND
[0002] In recent years, with the rapid development of remote sensing satellites and photoelectric load imaging, remote sensing image target detection has become an important research direction in the field of remote sensing image interpretation. As the main carrier of sea transportation, ships play an important role in cargo transportation, resource exploration and accident rescue. Thanks to the rapid development of sea transportation, the number of ships worldwide has increased significantly. In summary, the research on remote sensing image ship target detection has important research value in military and civilian fields. In the military field, by detecting the ship target on the sea in real time, the position and number of enemy ships can be quickly obtained, so as to master the initiative on the battlefield; in the civilian field, the detection of ship targets on the sea can be used for port management, sea rescue, and suppression of illegal fishing and smuggling. China is in the golden period of marine development, and remote sensing image ship target detection is of great significance to the maintenance of marine rights and interests and the development of marine economy. At present, the detection of ship targets in remote sensing images mainly faces the following difficulties:
[0003] 1. Dense arrangement: port ship targets are usually densely arranged, and the large aspect ratio makes the intersection over union (IoU) between the boundary boxes sensitive to the change of angle;
[0004] 2. Variable direction: ship targets may appear in any direction, which requires the detector to have accurate angle prediction capability;
[0005] 3. Complex background: the detection of near-shore ship targets is easily disturbed by the complex background on the shore. Traditional ship target detection methods rely on manually designed low-level visual features, and require a large amount of prior knowledge to set many parameters, which is high in complexity and low in accuracy.
[0006] Thanks to the powerful semantic representation ability of convolutional neural networks, remote sensing image ship target detection methods based on deep learning have developed rapidly. According to whether the ship direction is predicted in the detection result, the ship target detection method based on deep learning can be divided into non-directional and directional ship target detection methods. Non-directional ship target detection methods use horizontal boxes for labeling, and are mostly improved based on networks such as Faster R-CNN, YOLO and SSD. Due to the large aspect ratio of ship targets, using this kind of method will result in a large amount of background information in the detection box, and the detection accuracy is low when ships are densely arranged. Non-directional ship target detection methods use rotated boxes for labeling, and common ones are RRPN, RoI-Trans and R 3Networks such as Det. Due to the use of numerous anchor boxes of varying scales, proportions, and angles, these networks suffer from high parameter counts, computational complexity, and slow detection speeds. Furthermore, these methods all employ five-parameter regression approaches, where angle regression faces the problem of boundary discontinuities. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a method for detecting ship targets in remote sensing images based on convolutional neural networks. This invention enables high-precision detection of ship targets in any direction against complex backgrounds.
[0008] The technical means employed in this invention are as follows:
[0009] A method for ship target detection in remote sensing images based on convolutional neural networks, comprising:
[0010] Construct a dataset of remote sensing ship images and label the ship targets;
[0011] The constructed ship image dataset was augmented and divided into training, validation and test sets.
[0012] Construct an object detection network model based on an improved RetinaNet;
[0013] Initialize the network, set the training parameters, and train the constructed object detection network model using the training set;
[0014] The test set images are input into the trained target detection network model to predict the classification and regression results of ship targets.
[0015] Furthermore, the construction of the remote sensing ship image dataset and the annotation of ship targets include:
[0016] Remote sensing images of offshore, port, and island scenes containing ship targets were collected from Google Earth satellite maps, and the images were cropped to 1000×1000 pixels to form a dataset.
[0017] The ship targets in the dataset were labeled using the rotation labeling tool roLabelImg, resulting in an XML-formatted label file.
[0018] Furthermore, the constructed ship image dataset undergoes data augmentation and is divided into training, validation, and test sets, including:
[0019] Data augmentation is performed on the images in the dataset, including random flipping, random rotation, and random scaling, to obtain the complete dataset;
[0020] The complete dataset is divided into training, validation, and test sets in an 8:1:1 ratio.
[0021] Furthermore, the construction of the object detection network model based on the improved RetinaNet includes:
[0022] ResNet50 residual network was used as the feature extraction network.
[0023] Embed a coordinate attention module in the Feature Pyramid Network (FPN);
[0024] An orientation-invariant model is constructed using an active rotation filter (ARF) and directional response pooling (ORPooling).
[0025] Set horizontal anchor boxes of different scales and proportions to construct classification and regression subnetworks;
[0026] The MaxIoU allocation strategy is used to distinguish between positive and negative samples, and the Rotate-NMS post-processing method is used to remove redundant prediction boxes.
[0027] Focal Loss was used as the classification loss function, and KLD Loss was used as the regression loss function.
[0028] Furthermore, the embedding of a coordinate attention module in the Feature Pyramid Network (FPN) includes:
[0029] Constructing a Feature Pyramid Network (FPN):
[0030] Select the last layer feature maps {C3,C4,C5} of the last three residual blocks in ResNet50 to construct a bottom-up network;
[0031] A three-layer feature map {P3,P4,P5} is obtained by horizontally connected 1×1 convolutions and top-down upsampling, and a top-down network is constructed.
[0032] Feature maps P6 and P7 were obtained by downsampling feature map P5 twice.
[0033] Constructing a coordinate attention module:
[0034] For the input feature map Where C, H, and W represent the number of channels, height, and width, respectively; average pooling is performed along two orthogonal directions in the spatial dimension to obtain the horizontal feature map. and vertical feature map
[0035] v x and v y Merging yields the feature map And then 1×1 convolution (to achieve channel compression) and the Swish activation function were used to apply the effect to v. x,y Encode to obtain feature maps
[0036] v en Decompose to obtain feature maps and And then 1×1 convolution (to achieve channel expansion) and the Sigmoid activation function were used successively to... and Decode to obtain feature map and
[0037] Will and F in Multiply to obtain the output feature map.
[0038] Embedded coordinate attention module:
[0039] A coordinate attention module is added to the lateral connections and top-down feature fusion process of the Feature Pyramid Network (FPN).
[0040] Furthermore, the construction of the orientation-invariant model using Active Rotation Filter (ARF) and Oriented Response Pooling (ORPooling) includes:
[0041] Use ARF to encode direction information:
[0042] An ARF (Automatic Field Redirection) filter is a k×k×N filter that actively rotates N-1 times during convolution to generate a feature map with N directional channels, thus obtaining explicitly encoded position and orientation information. The directional response convolution between the input feature map M and the input feature map is:
[0043]
[0044] In the formula, I (i) To output the i-th direction channel of feature map I, for Rotate clockwise θ i The resulting new filter, and M (n) They are respectively The nth direction channel of M; I does not have rotational invariance;
[0045] Using ORPooling to extract rotation-invariant features:
[0046] ORPooling selects the directional channel with the strongest response in I as the final output feature map.
[0047]
[0048] in, It has rotational invariance, and targets in any direction at the center point have the same rotational invariance characteristics.
[0049] Furthermore, the step of setting horizontal anchor boxes of different scales and proportions to construct classification and regression sub-networks includes:
[0050] Set the anchor frame size to {2} 0 ,2 1 / 3 ,2 2 / 3 The ratio is {1:2, 1:1, 2:1}, and there are nine anchor boxes at each position of the feature map {P3, P4, P5, P6, P7}.
[0051] The classification subnetwork is used to predict the probability of an object being present in the detection box, and the regression subnetwork is used to predict the position, size, and angle of the detection box. Both are composed of five layers of 3×3 convolutions. The predicted feature maps of the classification and regression subnetworks have dimensions of KA×H×W and 5A×H×W, respectively, where A represents the number of anchor boxes at each position in the feature map, and K represents the number of object categories.
[0052] Furthermore, the use of Focal Loss as the classification loss function and KLD Loss as the regression loss function includes:
[0053] Focal Loss is defined as:
[0054]
[0055] In the formula, L cls Here, t is the classification loss function, p is the predicted probability of a positive sample, γ is used to reduce the weight of easily classified samples so that the network pays more attention to difficult-to-classify samples, and γ is set to 2; α is a balancing factor used to balance the number of positive and negative samples, and α is set to 0.25.
[0056] Convert the rotated bounding box to a two-dimensional Gaussian distribution. Where μ represents the mean and Σ represents the covariance matrix;
[0057] Calculate the two-dimensional Gaussian distribution of the prediction box. Two-dimensional Gaussian distribution of the true bounding box Kullback-Leibler divergence (KLD) between them:
[0058]
[0059] D kl Each item in the equation is composed of coupled partial parameters, resulting in a chain-like coupling relationship among all parameters.
[0060] KLD Loss is defined as:
[0061]
[0062] In the formula, L reg This is the regression loss function; the parameter τ is used to adjust the loss, and τ = 1 is set.
[0063] Further, the initialization of the network, setting of training parameters, and training of the constructed object detection network model using the training set include:
[0064] The backbone ResNet50 is initialized using pre-trained weights from ImageNet;
[0065] During network training, stochastic gradient descent (SGD) was used as the optimizer, with the momentum factor set to 0.9 and the weight decay set to 0.0001.
[0066] The initial learning rate was set to 0.0025, and the batch size was set to 2. The network was trained for a total of 50k iters, and the learning rate was reduced to 0.00025 and 0.000025 at 30k and 60k iters, respectively.
[0067] Furthermore, the step of inputting the test set images into the trained target detection network model to predict the classification and regression results of ship targets includes:
[0068] Precision and Recall are defined as follows:
[0069]
[0070]
[0071] In the formula, TP, FP, and FN represent the number of true positive, false positive, and false negative samples, respectively; if the IoU between the predicted box and the true box is greater than 0.5, the predicted box is considered a true positive sample.
[0072] The average precision (AP) is calculated as follows:
[0073]
[0074] In the formula, P and R represent precision and recall, respectively.
[0075] Compared with the prior art, the present invention has the following advantages:
[0076] 1. The remote sensing image ship target detection method based on convolutional neural network provided by the present invention extracts deep semantic features through deep convolutional neural network and performs feature fusion using feature pyramid to achieve multi-scale detection of ship targets.
[0077] 2. The remote sensing image ship target detection method based on convolutional neural network provided in this invention embeds a coordinate attention module in FPN to enhance the feature fusion process. The coordinate attention module increases the network's attention to the target by capturing cross-channel information, as well as orientation and position-sensitive information, so as to accurately locate and identify ship targets in complex backgrounds.
[0078] 3. The remote sensing image ship target detection method based on convolutional neural networks provided in this invention constructs an orientation-invariant model to enhance feature consistency in order to improve the network's adaptability to rotating targets. The orientation-invariant model generates depth rotation-invariant features, effectively improving the detection accuracy of ship targets in any orientation.
[0079] 4. The remote sensing image ship target detection method based on convolutional neural networks provided by this invention aims to achieve directed ship target detection and solve the discontinuity problem faced by traditional regression methods. It adds an angle parameter to the regression subnetwork and defines a KLD-based regression loss function. KLD can dynamically adjust the gradient of the angle parameter according to the aspect ratio characteristics of the target, thereby achieving high-precision detection of densely arranged ship targets.
[0080] Based on the above reasons, this invention can be widely applied in fields such as remote sensing image target detection. Attached Figure Description
[0081] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0082] Figure 1 This is a flowchart of the method of the present invention.
[0083] Figure 2 These are sample images from the remote sensing ship image dataset provided in this embodiment of the invention.
[0084] Figure 3 This is a schematic diagram of the improved RetinaNet object detection network provided in an embodiment of the present invention.
[0085] Figure 4 This is a schematic diagram of the coordinate attention module provided in an embodiment of the present invention. Detailed Implementation
[0086] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0087] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0088] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0089] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0090] In the description of this invention, it should be understood that the orientation or positional relationship indicated by directional terms such as "front, back, up, down, left, right", "horizontal, vertical, horizontal" and "top, bottom" is generally based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing this invention and simplifying the description. Unless otherwise stated, these directional terms do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the scope of protection of this invention. The directional terms "inner" and "outer" refer to the inner and outer contours relative to the outline of each component itself.
[0091] For ease of description, spatial relative terms such as "above," "over," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation besides the orientation of the device as described in the figures. For example, if the device in the figures is inverted, a device described as "above" or "above" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0092] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore should not be construed as limiting the scope of protection of this invention.
[0093] like Figure 1 As shown, this invention provides a method for detecting ship targets in remote sensing images based on convolutional neural networks, including:
[0094] S1. Construct a dataset of remote sensing ship images and label the ship targets;
[0095] S2. Perform data augmentation on the constructed ship image dataset and divide it into training set, validation set and test set;
[0096] S3. Construct an object detection network model based on an improved RetinaNet;
[0097] S4. Initialize the network, set the training parameters, and train the constructed object detection network model using the training set;
[0098] S5. Input the test set images into the trained target detection network model to predict the classification and regression results of ship targets.
[0099] In a specific implementation, as a preferred embodiment of the present invention, step S1, which involves constructing a remote sensing ship image dataset and labeling the ship targets, includes:
[0100] S11. Collect remote sensing images of offshore, port, and island scenes containing ship targets from Google Earth satellite maps, and crop the images to 1000×1000 pixels to form a dataset; such as Figure 2 The image shown is a sample image from the remote sensing ship image dataset.
[0101] S12. Use the rotation annotation tool roLabelImg to annotate the ship targets in the dataset to obtain an XML format annotation file.
[0102] In a preferred embodiment of the present invention, step S2 involves data augmentation of the constructed ship image dataset and its division into a training set, a validation set, and a test set, including:
[0103] S21. Perform data augmentation on the images in the dataset, including random flipping, random rotation, and random scaling, to obtain the complete dataset;
[0104] S22. Divide the complete dataset into training set, validation set and test set in a ratio of 8:1:1.
[0105] In a specific implementation, as a preferred embodiment of the present invention, step S3, which involves constructing a target detection network model based on an improved RetinaNet, includes:
[0106] S31. Use ResNet50 residual network as the feature extraction network;
[0107] In this embodiment, as Figure 3 The diagram illustrates an improved RetinaNet object detection network. ResNet50 mitigates the degradation problem of deep networks by stacking residual blocks and uses batch normalization (BN) to address the vanishing or exploding gradient problem. Each residual block consists of three convolutional layers: a 1×1 convolution, a 3×3 convolution, and a 1×1 convolution. Residual connections only occur when the number of channels in the input and output features are the same.
[0108] S32. Embed a coordinate attention module in the Feature Pyramid Network (FPN);
[0109] In this embodiment, step S32 includes the following steps:
[0110] S321. First, select the last layer feature maps {C3, C4, C5} of the last three residual blocks in ResNet50 to construct a bottom-up network. Then, obtain three feature maps {P3, P4, P5} through laterally connected 1×1 convolutions and top-down upsampling to construct a top-down network. Finally, downsample feature map P5 twice to obtain feature maps P6 and P7. Through the above process, the construction of FPN is achieved.
[0111] S322, such as Figure 4 The diagram shows a coordinate attention module. For the input feature map... Where C, H, and W represent the number of channels, height, and width, respectively. First, average pooling is performed along two orthogonal directions in the spatial dimension to obtain the horizontal feature map. and vertical feature map Secondly, v x and v y Merging yields the feature map And then 1×1 convolution (to achieve channel compression) and the Swish activation function were used to apply the effect to v. x,y Encode to obtain feature maps Then, v en Decompose to obtain feature maps and And then 1×1 convolution (to achieve channel expansion) and the Sigmoid activation function were used successively to... and Decode to obtain feature map and Finally, and F in Multiply to obtain the output feature map. The coordinate attention module is constructed through the above process. It is incorporated into the lateral connections and top-down feature fusion processes of the FPN.
[0112] S33. Construct an orientation-invariant model using Active Rotation Filter (ARF) and Oriented Response Pooling (ORPooling);
[0113] In this embodiment, step S33 includes the following steps:
[0114] S331. Use ARF to encode orientation information. An ARF is a k×k×N filter that actively rotates N-1 times during convolution to generate a feature map with N orientation channels, thus obtaining explicitly encoded position and orientation information. (Filter) The directional response convolution between the input feature map M and the input feature map is:
[0115]
[0116] In the formula, I (i) To output the i-th direction channel of feature map I, for Rotate clockwise θ i The resulting new filter, and M (n) They are respectively And the nth direction channel of M. I does not have rotational invariance;
[0117] S332. Use ORPooling to extract rotation-invariant features. ORPooling selects the direction channel with the strongest response in I as the final output feature map.
[0118]
[0119] in, It exhibits rotational invariance. Targets in any direction at the center point have the same rotational invariance characteristics.
[0120] S34. Set horizontal anchor boxes of different scales and proportions to construct classification and regression subnetworks;
[0121] In this embodiment, step S34 includes the following steps:
[0122] S341. Set the anchor frame size to {2} 0 ,2 1 / 3 ,2 2 / 3 The ratio is {1:2, 1:1, 2:1}, and there are nine anchor boxes at each position of the feature map {P3, P4, P5, P6, P7}.
[0123] S342. The classification subnetwork predicts the probability of an object being present in the detection box, while the regression subnetwork predicts the position, size, and angle of the detection box. Both consist of five 3×3 convolutional layers. The predicted feature maps of the classification and regression subnetworks have dimensions of KA×H×W and 5A×H×W, respectively, where A represents the number of anchor boxes at each location in the feature map, and K represents the number of object categories.
[0124] S35. Use the MaxIoU allocation strategy to distinguish between positive and negative samples, and use the Rotate-NMS post-processing method to remove redundant prediction boxes.
[0125] In this embodiment, step S35 includes the following steps:
[0126] S351. Use the MaxIoU allocation strategy to distinguish between positive and negative samples. If the IoU between the anchor box and the ground truth box is greater than 0.5, it is a positive sample; if the IoU between the anchor box and all ground truth boxes is less than 0.4, it is a negative sample; the remaining anchor boxes are discarded.
[0127] S352. Use the Rotate-NMS post-processing method to remove redundant prediction boxes. Set the IoU threshold to 0.75.
[0128] S36. Use Focal Loss as the classification loss function and KLD Loss as the regression loss function.
[0129] In this embodiment, step S36 includes the following steps:
[0130] S361. Focal Loss is defined as:
[0131]
[0132] In the formula, L cls Here, t is the classification loss function, p is the predicted probability of a positive sample, γ is used to reduce the weight of easily classified samples so that the network pays more attention to difficult-to-classify samples, and γ is set to 2; α is a balancing factor used to balance the number of positive and negative samples, and α is set to 0.25.
[0133] S362. Convert the rotated bounding box to a two-dimensional Gaussian distribution. Where μ represents the mean and Σ represents the covariance matrix;
[0134] S363. Calculate the two-dimensional Gaussian distribution of the prediction box. Two-dimensional Gaussian distribution of the true bounding box Kullback-Leibler divergence (KLD) between them:
[0135]
[0136] D kl Each item in the equation is composed of coupled partial parameters, resulting in a chain-like coupling relationship among all parameters.
[0137] S364. Define KLD Loss as:
[0138]
[0139] In the formula, L reg This is the regression loss function; the parameter τ is used to adjust the loss, and τ = 1 is set.
[0140] In a specific implementation, as a preferred embodiment of the present invention, step S4, which involves initializing the network, setting training parameters, and training the constructed object detection network model using the training set, includes:
[0141] S41. Initialize the backbone ResNet50 using pre-trained weights from ImageNet;
[0142] S42. During network training, stochastic gradient descent (SGD) is used as the optimizer, with the momentum factor set to 0.9 and the weight decay set to 0.0001.
[0143] S43. Set the initial learning rate to 0.0025 and the batch size to 2. Train the network for a total of 50k iter, and reduce the learning rate to 0.00025 and 0.000025 at 30k and 60k iter, respectively.
[0144] In a preferred embodiment of the present invention, step S5 involves inputting test set images into the trained target detection network model to predict the classification and regression results of ship targets, including:
[0145] S51. Precision and Recall are defined as follows:
[0146]
[0147]
[0148] In the formula, TP, FP, and FN represent the number of true positive, false positive, and false negative samples, respectively; if the IoU between the predicted box and the true box is greater than 0.5, the predicted box is considered a true positive sample.
[0149] S52. Calculate the average precision AP as follows:
[0150]
[0151] In the formula, P and R represent precision and recall, respectively.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting a ship target in a remote sensing image based on a convolutional neural network, characterized in that, include: Construct a dataset of remote sensing ship images and label the ship targets; The constructed ship image dataset was augmented and divided into training, validation and test sets. Construct an object detection network model based on an improved RetinaNet, including: ResNet50 residual network was used as the feature extraction network. Embed a coordinate attention module in the Feature Pyramid Network (FPN); An orientation-invariant model is constructed using Active Rotation Filter (ARF) and Oriented Response Pooling (ORPooling), including: Use ARF to encode direction information: ARF is a filter that actively rotates the filter in the convolution process times to generate a feature map with direction channels, obtaining explicit encoded position and direction information; the filter convolves with the direction response between the input feature map In the formula, is the first direction channel of the output feature map is the first direction channel of the output feature map is the first direction channel of the output feature map is the first direction channel of the output feature map is the new filter obtained by clockwise rotation is the new filter obtained by clockwise rotation is the first direction channel of the output feature map is the first direction channel of the output feature map is the first direction channel of the output feature map is the first direction channel of the output feature map is the first direction channel of the output feature map does not have rotation invariance; Using ORPooling to extract rotation-invariant features: OR pooling selection The direction channel with the strongest response is selected as the final output feature map : wherein, has a rotation invariance, an arbitrary directional target at the center point has the same rotation invariance feature; Set horizontal anchor boxes of different scales and proportions to construct classification and regression subnetworks; The MaxIoU allocation strategy is used to distinguish between positive and negative samples, and the Rotate-NMS post-processing method is used to remove redundant prediction boxes. Focal Loss was used as the classification loss function, and KLD Loss was used as the regression loss function. Initialize the network, set the training parameters, and train the constructed object detection network model using the training set; The test set images are input into the trained target detection network model to predict the classification and regression results of ship targets.
2. The remote sensing image ship target detection method based on a convolutional neural network according to claim 1, characterized in that, The construction of the remote sensing ship image dataset and the annotation of ship targets include: Remote sensing images of offshore, port, and island scenes containing ship targets were collected from Google Earth satellite maps, and the images were cropped to 1000×1000 pixels to form a dataset. The ship targets in the dataset were labeled using the rotation labeling tool roLabelImg, resulting in an XML-formatted label file. 3.The method of claim 1, wherein, The constructed ship image dataset is augmented and divided into training, validation, and test sets, including: Data augmentation is performed on the images in the dataset, including random flipping, random rotation, and random scaling, to obtain the complete dataset; The complete dataset is divided into training, validation, and test sets in an 8:1:1 ratio.
4. The remote sensing image ship target detection method based on a convolutional neural network according to claim 1, characterized in that, The method of embedding a coordinate attention module in the Feature Pyramid Network (FPN) includes: Constructing a Feature Pyramid Network (FPN): Select the last layer feature maps {C3,C4,C5} of the last three residual blocks in ResNet50 to construct a bottom-up network; A three-layer feature map {P3,P4,P5} is obtained by horizontally connected 1×1 convolutions and top-down upsampling, and a top-down network is constructed. Feature maps P6 and P7 were obtained by downsampling feature map P5 twice. Constructing a coordinate attention module: For the input feature map where , and denote the number of channels, height and width, respectively; average pooling is performed along two orthogonal directions in the spatial dimension to obtain the horizontal feature map and the vertical feature map ; Merging and to obtain a feature map , and sequentially encoding using a 1x1 convolution realizing channel compression and a Swish activation function to obtain a feature map ; Splitting is performed to obtain feature maps Splitting is performed to obtain feature maps and and Sigmoid activation function realizing channel expansion are used in sequence to decode and to obtain feature maps and ; Multiplying , and , an output feature map is obtained. Embedded coordinate attention module: A coordinate attention module is added to the lateral connections and top-down feature fusion process of the Feature Pyramid Network (FPN). 5.The method of claim 1, wherein, The process of setting horizontal anchor boxes of different scales and proportions to construct classification and regression sub-networks includes: The scale of the anchor frame is set to {2 0 ,2 1 / 3 ,2 2 / 3}, the ratio is {1:2, 1:1, 2:1}, and there are nine anchor frames at each position of the feature map {P3, P4, P5, P6, P7}. The classification subnetwork is used to predict the probability of the existence of a target in the detection frame, and the regression subnetwork is used to predict the position, size and angle of the detection frame, both of which are composed of five layers of 3x3 convolution; the sizes of the prediction feature maps of the classification and regression subnetworks are and wherein represents the number of anchor frames at each position in the feature map, represents the number of categories of the target. 6.The method of claim 1, wherein, The use of Focal Loss as the classification loss function and KLD Loss as the regression loss function includes: Focal Loss is defined as: In the formula, is a classification loss function, is the label of the sample, is the predicted probability of the positive sample; the parameter is used to reduce the weight of easy-to-classify samples, so that the network pays more attention to difficult-to-classify samples, and is set to ; the parameter is a balance factor used to balance the number of positive and negative samples, and is set to ; Converting a rotating bounding box to a two-dimensional Gaussian distribution wherein denotes the mean, denotes the covariance matrix; Calculate the two-dimensional Gaussian distribution of the prediction box. Two-dimensional Gaussian distribution of the true bounding box Kullback-Leibler divergence (KLD) between: Each of the items in the list is coupled by partial parameters, such that all parameters form a chain-coupled relationship; KLD Loss is defined as: In the formula, is a regression loss function; parameters for adjusting the loss, set .
7. The remote sensing image ship target detection method based on a convolutional neural network according to claim 1, characterized in that, The initialization network, setting training parameters, and training the constructed target detection network model using a training set, comprising: using the pre-training weight on ImageNet to initialize the main ResNet50; using random gradient descent as the optimizer during the network training process, setting the momentum factor to 0.9, and setting the weight decay to 0.0001; setting the initial learning rate to 0.0025 and the batch size to 2; training the network for 50k iter, and reducing the learning rate to 0.00025 and 0.000025 at 30k and 60k iter, respectively. 8.The method of claim 1, wherein, The test set image is input into the trained target detection network model, and the classification and regression results of the ship target are predicted, comprising: defining the precision Precision and the recall Recall as: in the formula, TP, FP and FN are the number of true positive, false positive and false negative samples, respectively; if the IoU between the predicted frame and the real frame is greater than 0.5, the predicted frame is considered as a true positive sample; calculating the average precision AP as follows: wherein and precision and recall, respectively.
Citation Information
Patent Citations
Remote sensing image rotating ship detection method based on feature pyramid
CN112395969A
SAR image rotating ship detection method based on directed Gaussian function
CN113239953A