A rotating target detection method, device and storage device based on Efficientdet
By introducing an eight-parameter regression loss function and two-way cross-scale feature fusion into the EfficientDet network, the problem of sudden changes in the boundaries of rotating boxes in remote sensing images is solved, and the performance and accuracy of rotating target detection are improved.
Patent Information
- Application Number
- CN202111677109.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In remote sensing images, the traditional five-parameter rotating frame coordinate regression method has a boundary mutation problem, which leads to poor angle and shape prediction accuracy, especially in small targets and variable angle scenes, affecting detection performance.
An eight-parameter regression loss function is introduced to calculate the loss through the minimum value of the four vertices of the prediction frame moving clockwise, keeping the order unchanged, and moving counterclockwise. Combined with the bidirectional cross-scale feature fusion network, the EfficientDet network structure is improved to solve the angular regression discontinuity. .
It improves the detection performance of rotating target detection, maintains the consistency of regression parameters, improves the prediction accuracy of angles and shapes, and solves the problem of sudden changes in the boundary of rotating boxes.
Smart Images

Figure CN114330581B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual target detection, and in particular to a rotation target detection method, device and storage device based on Efficientdet. Background Art
[0002] Small target detection in remote sensing images is one of the research hotspots in the field of remote sensing. The development of high spatial resolution (HSR) remote sensing image sensors has accelerated the acquisition of various remote sensing images such as aerial and satellite images with sufficiently detailed spatial structure information. These remote sensing images can facilitate a wide range of military and civilian applications, such as ocean monitoring, urban area detection, cargo transportation, port management, etc. Different from acquiring natural images on the ground from the horizontal direction, obtaining high spatial resolution remote sensing images requires viewing from a top-down perspective, which is an image acquisition method that is easily affected by weather and lighting. In addition, the small and variable scale characteristics of many types of geospatial objects and the lack of manually annotated training samples make the detection task more challenging. Many studies related to small target detection in remote sensing images have been carried out.
[0003] In recent years, with the development of deep learning technology, researchers have been committed to designing a network to solve the multi-scale problem in target detection, and some multi-scale feature fusion methods have also emerged. The introduction of FPN (Feature Pyramid Networks) has made multi-scale feature fusion technology widely used in computer vision tasks. In recent years, PANet, NAS-FPN and other studies have developed more network structures for cross-scale feature fusion based on FPN. BiFPN (Bidirectional cross-scale connections and weighted feature fusion) proposes a simple and efficient weighted bidirectional feature pyramid network, which introduces learnable weights to learn the importance of different input feature layers and can be modularly repeated. The advantage of EfficientDet is that it achieves better performance than other target detectors with fewer parameters and computational complexity, and BiFPN has excellent cross-scale feature fusion capabilities.
[0004] In summary, although researchers have made great efforts and achieved some success, due to the complexity and variability of remote sensing image data, there are still many contents that need to be studied in depth, especially in the regression of directional target angles, which is mainly reflected in the following aspects:
[0005] In the case of oriented target detection, the coordinate regression of the rotating frame based on the common five-parameter representation is accompanied by a typical boundary mutation problem. The boundary mutation problem is a unique feature of the rotating frame. Since the same rotating frame can have multiple representation values under a parameter representation scheme, the specific representation value is limited to a specific range by imposing rules, so that the same rotating frame only corresponds to a unique parameter representation value under a parameter representation scheme, resulting in a mutation of the representation value at the boundary of the range, affecting the detection accuracy of the boundary value. However, most of the targets in remote sensing images are small targets and have variable angles, which makes traditional target detection methods ineffective.
[0006] Existing region-based rotation object detectors usually regress five parameters (center point coordinates, width, height, rotation angle) to describe the rotation bounding box, and use Smooth L1 Loss as the loss function. However, this method has problems in practice. For the five-parameter representation of oriented target detection, if the angle period is 180°, the boundary values 0° and 180° actually coincide, but there is a 180-degree difference in value, which produces a mutation and affects the prediction accuracy of the angle; if the period is 90°, in addition to the angle mutation on the boundary, the width and height will also be exchanged on the boundary, resulting in mutations. Therefore, when the period is 90°, the mutations generated are more complex, and the prediction of angles and shapes will be affected, which makes the situation worse. In order to solve the problem of rotation box boundary mutation caused by loss discontinuity caused by the traditional five-parameter (x, y, w, h, θ) angle regression loss function, the present invention proposes to introduce an eight-parameter (x1, y1, x2, y2, x3, y3, x4, y4) regression loss function. In the eight-parameter model, all parameters are the point coordinates of the four corners of the bounding box. The detection based on the eight-parameter regression directly regresses the four points of the object. The loss function of the eight-parameter regression directly regresses the coordinate positions of the four corners of the small target. Therefore, the prediction is a quadrilateral, so that the consistency of the regression parameters can be maintained to a certain extent. Summary of the invention
[0007] In order to solve the above problems, the present invention provides a rotating target detection method, device and storage device based on Efficientdet, introduces an eight-parameter position regression loss function to solve the problem of angle regression discontinuity, and improves the detection performance of the network.
[0008] A rotating target detection method based on Efficientdet mainly includes the following steps:
[0009] S101: constructing a remote sensing image rotation target detection network structure with a bidirectional cross-scale connection feature fusion structure; designing an eight-parameter loss function of rotation loss to obtain a final angle position loss function, and combining the final angle position loss function with the remote sensing image rotation target detection network structure to obtain a final network structure;
[0010] S102: training the remote sensing image rotation target detection network structure by using transfer learning to obtain a trained network structure;
[0011] In the final network structure training process, the improved EfficientNet network is used to extract features of each layer of the input image, and the bidirectional cross-scale connection feature fusion network is used to fuse the extracted features of each layer to obtain several output feature layers;
[0012] Inputting the output feature layer into the detection layer, thus obtaining a trained network;
[0013] S103: Inputting the remote sensing data set into the trained network structure to obtain the target detection result of the remote sensing image.
[0014] Furthermore, the eight parameters are the point coordinates of the four corners in the bounding box, which are obtained by the following parts: i) moving the four vertices of the prediction box clockwise by one position; ii) keeping the order of the vertices of the prediction box unchanged; iii) moving the four vertices of the prediction box counterclockwise by one position; iv) taking the minimum value of the above three cases.
[0015] Furthermore, the eight-parameter loss function is:
[0016]
[0017] Among them, x i and i They represent the coordinate offset between the i-th vertex of the prediction box and the i-th vertex of the reference box, and denotes the offset between the ith vertex of the ground truth box and the ith vertex of the reference box, x (i+3)%4 With y (i+3)%4 Represents the coordinates of the four vertices of the prediction box after moving one position clockwise, x i With y i Represents the coordinates that keep the order of the predicted box vertices unchanged, x (i+1)%4 With y (i+1)%4 Represents the coordinates of moving the four vertices of the prediction box counterclockwise by one position.
[0018] Furthermore, the final angle position loss function is:
[0019]
[0020] Where N represents the number of rotation target detection anchors based on Efficientdet, t' n The value is 0 or 1, v' nj represents the predicted offset vector, v nj The target vector representing the ground truth box, t n is the target category, p n is the probability distribution of each category calculated by sigmoid, L cls is focal loss, L reg is the smooth L1 loss, λ1 and λ2 are both hyper parameters.
[0021] Furthermore, the improved EfficientDet network refers to changing the original horizontal box into a rotated box.
[0022] A storage device, wherein the storage device stores instructions and data for implementing the rotating target detection method based on Efficientdet.
[0023] A rotating target detection device based on Efficientdet comprises: a processor and a storage device; the processor loads and executes instructions and data in the storage device to implement the rotating target detection method based on Efficientdet.
[0024] The technical solution provided by the present invention has the beneficial effects of: solving the problem of angle regression discontinuity in rotating object detection and improving the detection performance of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0026] Figure 1 It is a schematic diagram of the network structure in an embodiment of the present invention.
[0027] Figure 2 Schematic diagram of a rotating box representation of five parameters in an embodiment of the present invention.
[0028] Figure 3 Schematic diagram of loss discontinuity caused by angle parameters in an embodiment of the present invention.
[0029] Figure 4 It is a schematic diagram of the operation of the hardware device in the embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0031] Traditionally, five parameters are used to represent the position information of a rotating box; the five-parameter rotating box network based on Efficientdet represents information such as Figure 2 As shown, in Figure 2 middle,
[0032] ① Define a reference line along the horizontal direction, which is located at the vertex with the smallest vertical coordinate.
[0033] ② Rotate the reference line counterclockwise. The width of the first rectangle side that touches the reference line is defined as width w, and the other side as height h.
[0034] ③The coordinates of the center point are (x, y) and the rotation angle is θ.
[0035] So the five parameters are (x, y, w, h, θ), the center point coordinates are (x, y), the rotation angle is θ, and the value range is [-90°, 0°).
[0036] Existing region-based rotation object detectors usually regress five parameters (center point coordinates, width, height, rotation angle) to describe the rotation bounding box and use "smooth l1 loss" as the loss function. However, this approach has two fundamental problems in practice:
[0037] First, the loss discontinuity is caused by the angle parameter. When the angle reaches the boundary of its range, the loss value will jump, such as Figure 3 As shown: the green box is the network training prediction offset: -89°; the red box is the network training target, which is the groundtruth real box: -1°; the blue box is the network's prior box -90°. It can be seen that the position of the reference rectangle has only changed slightly, but due to parameterization, its angle has changed a lot. In addition, in the OpenCV parameter system, the definition of height and width has also been swapped, which makes the situation worse. It can be seen that the actual prediction box is only 2° different from the real box, but under the expression of five parameters, the loss will become very large and will cause loss discontinuity in boundary cases, making it difficult for the network to learn and train.
[0038] In order to solve the above problems, the embodiment of the present invention provides a rotating target detection method based on Efficientdet, which is constructed as follows: Figure 1The network structure shown in the figure has an improved EfficientNet as the backbone network. By modifying the loss function, an eight-parameter loss function is introduced to avoid inconsistent regression parameters. The horizontal box is changed to a rotation box. The rotation box can detect the position coordinates of the object and the rotation angle of the object based on the horizontal box. The targets in remote sensing images are often densely arranged and have variable angles. Using a rotation box for target detection in remote sensing images is more advantageous and can better represent the real information of the object. The neck feature fusion network is BIFPN. In the eight-parameter model, all parameters are the point coordinates of the corners in the bounding box, so the consistency of the regression parameters naturally remains unchanged. Figure 3 As shown. Define the first point in the upper left corner as a, and arrange it clockwise as a→b→c→d. So the eight-point parameter representation method is: (Pa, Pb, Pc, Pd); where Pa is (X_a, Y_a).
[0039] An eight-parameter version of the designed rotation loss consists of three parts: i) shifting the four vertices of the prediction box by one position clockwise; ii) keeping the order of the vertices of the prediction box unchanged; iii) shifting the four vertices of the prediction box by one position counterclockwise; iv) taking the minimum value of the above three cases.
[0040] The specific steps of the rotating target detection method include:
[0041] S101: Design an eight-parameter loss function of rotation loss to obtain a final angle position loss function, and use the final angle position loss function to construct a remote sensing image rotation target detection network structure with a bidirectional cross-scale connection feature fusion structure;
[0042] The eight-parameter loss function is:
[0043]
[0044] Among them, x i and i They represent the coordinate offset between the i-th vertex of the prediction box and the i-th vertex of the reference box, and denotes the offset between the ith vertex of the ground truth box and the ith vertex of the reference box, x (i+3)%4 With y (i+3)%4 Represents the coordinates of the four vertices of the prediction box after moving one position clockwise, x i With y i Represents the coordinates that keep the order of the predicted box vertices unchanged, x (i+1)%4 With y (i+1)%4 Represents the coordinates of moving the four vertices of the prediction box counterclockwise by one position.
[0045] The final angle position loss function is:
[0046]
[0047] Where N represents the number of rotation target detection anchors based on Efficientdet, t' n The value is 0 or 1, t' n =1 indicates foreground, t' n =0 means background, no regression, v' nj represents the predicted offset vector, v nj The target vector representing the ground truth box, t n is the target category, p n is the probability distribution of each category calculated by sigmoid, L cls is focal loss, L reg is smooth L1 loss, λ1 and λ2 represent hyper parameters, and in this embodiment, the hyper parameters are all set to 1.
[0048] S102: training the remote sensing image rotation target detection network structure by using transfer learning to obtain a trained network structure;
[0049] During the training process of the network structure for rotating target detection in remote sensing images, the EfficientNet network is used to extract features of each layer of the input image, and the bidirectional cross-scale connection feature fusion network is used to fuse the extracted features of each layer to obtain 5 output feature layers;
[0050] Inputting the output feature layer into the detection layer, thus obtaining a trained network;
[0051] S103: Inputting the remote sensing data set into the trained network structure to obtain the target detection result of the remote sensing image.
[0052] In order to verify the performance of the algorithm of the present invention, the present invention was tested on the rotating frame remote sensing image dataset. And the Efficientdet rotating frame algorithm with eight-parameter loss function was compared with the original algorithm by ablation experiment. The experiment was carried out on an Ubuntu computer with a 3.3GHz 10940X Inter Core I9 CPU and 11GB memory NVIDA Geforce RTX 2080Ti. All experimental results were obtained under the same IoU threshold of 0.5 and detection confidence threshold of 0.5.
[0053] In order to reliably evaluate and verify the proposed method, the present invention uses the USAC-AOD dataset and performs tests on it. The test results are shown in the following table:
[0054]
[0055] Multi-strategy training consists of two stages: pre-training and training. In the pre-training stage, the convolutional layer of EfficientNet is first pre-trained using the imagenet dataset, then the convolutional layer of EfficientNet in the model is frozen, the other network parts are trained using the UCAS-AOD dataset, and then the entire network is fine-tuned. In the training stage, the network is first initialized using the pre-trained model, the convolutional layer parameters of EfficientNet are frozen, the other parameters are trained, and then the entire network is fine-tuned to finally obtain the target model.
[0056] The present invention studies the task of rotating target detection in optical remote sensing images by improving the network structure model and loss function, and performs evaluation experiments on the validation set. The experiment proves that the algorithm of the present invention improves the accuracy of rotating target detection. By analyzing the detection results, the following conclusions are drawn: the algorithm network structure proposed by the present invention is more reasonable, and the training process is easier to converge. Better experimental results can be obtained under the support of transfer learning. The eight-parameter loss function can better regress the bounding box of the rotating object and solve the problem of discontinuous angle loss in rotation detection.
[0057] See also Figure 4 , Figure 4 4 is a schematic diagram of the working of the hardware device of an embodiment of the present invention, wherein the hardware device specifically comprises: a rotating target detection device 401 based on Efficientdet, a processor 402 and a storage device 403.
[0058] A rotating target detection device 401 based on Efficientdet: The rotating target detection device 401 based on Efficientdet implements the rotating target detection method based on Efficientdet.
[0059] Processor 402: The processor 402 loads and executes instructions and data in the storage device 403 to implement the rotating target detection method based on Efficientdet.
[0060] Storage device 403: The storage device 403 stores instructions and data; the storage device 403 is used to implement the rotating target detection method based on Efficientdet.
[0061] The beneficial effects of the present invention are as follows: the eight-parameter loss function can better regress the bounding box of the rotated object, solve the problem of angle regression discontinuity in rotating object detection, and improve the detection performance of the network.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A rotating target detection method based on Efficientdet, characterized in that: The following steps are involved: S101: constructing a remote sensing image rotation target detection network structure with a bidirectional cross-scale connection feature fusion structure; designing an eight-parameter loss function of rotation loss to obtain a final angle position loss function, and combining the final angle position loss function with the remote sensing image rotation target detection network structure to obtain a final network structure; The eight-parameter loss function is: Among them, x i and i They represent the coordinate offset between the i-th vertex of the prediction box and the i-th vertex of the reference box, and denotes the offset between the ith vertex of the ground truth box and the ith vertex of the reference box, x (i+3)%4 With y (i+3)%4 Represents the coordinates of the four vertices of the prediction box after moving one position clockwise, x i With y i Represents the coordinates that keep the order of the predicted box vertices unchanged, x (i+1)%4 With y (i+1)%4 Represents the coordinates of moving the four vertices of the prediction box counterclockwise by one position; The final angle position loss function is: Where N represents the number of rotation target detection anchors based on Efficientdet, t' n The value is 0 or 1, v' nj represents the predicted offset vector, v nj The target vector representing the ground truth box, t n is the target category, p n is the probability distribution of each category calculated by sigmoid, L cls is focal loss, L reg is smooth L1 loss, λ1 and λ2 are both hyper parameters; S102: training the remote sensing image rotation target detection network structure by using transfer learning to obtain a trained network structure; In the final network structure training process, the improved EfficientNet network is used to extract features of each layer of the input image, and the bidirectional cross-scale connection feature fusion network is used to fuse the extracted features of each layer to obtain several output feature layers; Inputting the output feature layer into the detection layer, thus obtaining a trained network; S103: Inputting the remote sensing data set into the trained network structure to obtain the target detection result of the remote sensing image.
2. The rotating target detection method based on Efficientdet according to claim 1, characterized in that: In step S101, the eight parameters are the point coordinates of the four corners in the bounding box, which are obtained by the following parts: i) moving the four vertices of the prediction box clockwise by one position; ii) keeping the order of the vertices of the prediction box unchanged; iii) moving the four vertices of the prediction box counterclockwise by one position; iv) taking the minimum value of the above three cases.
3. The rotating target detection method based on Efficientdet according to claim 1, characterized in that: In step S102, the improved EfficientDet network refers to changing the original horizontal box into a rotated box.
4. A storage device, characterized in that: The storage device stores instructions and data for implementing a rotating target detection method based on Efficientdet as described in any one of claims 1 to 3.
5. A rotating target detection device based on Efficientdet, characterized in that: include: A processor and a storage device; the processor loads and executes instructions and data in the storage device to implement a rotating target detection method based on Efficientdet as described in any one of claims 1 to 3.
