Directional target detection method based on focal rotation intersection-over-union ratio bounding box regression loss
By introducing a focus rotation intersection-union ratio bounding box regression loss function into target detection of high-resolution remote sensing images, the problem that the loss function in existing methods cannot directly optimize the evaluation index is solved, thereby improving detection accuracy and positioning accuracy.
Patent Information
- Application Number
- CN202310423678.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-03
- Filing Date
- 2023-04-18
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-04-18
AI Technical Summary
The loss functions of existing high-resolution remote sensing image target detection methods fail to directly optimize the evaluation index, resulting in low detection accuracy.
A directed target detection method based on focus rotation intersection-union ratio bounding box regression loss is adopted. By directly linking the loss function with the evaluation index and adaptively changing the gradient during the optimization process, the detection accuracy is improved.
It improves the accuracy of target detection in high-resolution remote sensing images and enables more accurate target localization.
Smart Images

Figure CN117765380B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of object detection in deep learning, and more particularly to a directed object detection method based on focus rotation intersection-union ratio bounding box regression loss. Background Technology
[0002] High-resolution remote sensing image target detection is one of the most important tasks in the field of optical remote sensing image processing, dedicated to locating and identifying high-value ground objects in high-resolution remote sensing images. With the implementation of the High-Resolution Earth Observation System (Gaofen) Major Project (one of the 16 major projects in the National Medium- and Long-Term Science and Technology Development Plan), my country's remote sensing data acquisition technology has developed rapidly. Mining remote sensing big data has become a key aspect of the Gaofen Major Project, and high-resolution remote sensing image target detection is one of the key technologies for remote sensing big data mining. It is also one of the core issues in applications such as environmental monitoring, disaster prevention and mitigation, military reconnaissance, and precision strikes, possessing significant civilian and military application value.
[0003] There are various methods for target detection in high-resolution remote sensing images, which can be broadly categorized into two types based on their development stage: those based on handcrafted features and those based on data-driven approaches. Data-driven methods, due to their powerful feature representation capabilities, have become the mainstream approach in the field of high-resolution remote sensing image target detection. Data-driven methods can be further divided into shallow learning and deep learning methods based on the depth of their network layers. Deep learning-based methods generally achieve higher detection accuracy than shallow learning-based methods, and therefore, deep learning-based target detection methods are widely used in the field of high-resolution remote sensing image target detection.
[0004] Deep learning-based object detection methods mainly include one-stage and two-stage methods. Compared to two-stage methods, one-stage methods have relatively lower detection accuracy, thus limiting their application in high-resolution remote sensing image object detection. Two-stage object detection methods consist of a candidate region generation network and a region detection module. The region detection module primarily uses the Smooth L1 loss function to optimize bounding box positions, but this loss function fails to directly optimize evaluation metrics, which limits the optimization effect to some extent. Summary of the Invention
[0005] To address the technical problem of low detection accuracy caused by the failure of existing target detection methods to directly optimize evaluation metrics through loss functions, this invention proposes a directed target detection method based on focus rotation intersection-union ratio bounding box regression loss. This method directly establishes a link between the loss function and evaluation metrics, and can adaptively change the gradient during the optimization process, thereby further improving the accuracy of target detection in high-resolution remote sensing images.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows: a directed target detection method based on focus rotation intersection-union ratio bounding box regression loss, the steps of which are as follows:
[0007] Step 1: Using labeled high-resolution remote sensing images as training images, train a coarse directed candidate box generation module; the loss function of the coarse directed candidate box generation module is the joint loss of the binary classification loss function and the bounding box regression loss function.
[0008] Step 2: Feed the coarse directed candidate boxes generated by the trained coarse directed candidate box generation module into the fine directed candidate box generation module, and train the fine directed candidate box generation module using the focus rotation intersection-union regression loss function.
[0009] Step 3: Training the region detection module: The region detection module is trained using fine-grained directed candidate boxes as candidate target boxes; the region detection module uses the focal rotation intersection-union regression loss function as the bounding box regression loss function.
[0010] Step 4: The trained coarse directed candidate box generation module, fine directed candidate box generation module, and region detection module form a target detection model. The high-resolution remote sensing image to be detected is input into the target detection model to obtain the location and category of the target of interest in the high-resolution remote sensing image to be detected.
[0011] Preferably, the method for training the coarse-point candidate box generation module is as follows:
[0012] Step 1.1: Preprocess the training images and target locations according to aspect ratio: Sort the training images according to aspect ratio from smallest to largest. The aspect ratio of the training images is limited to between 0.5 and 2.0. Crop the training images with aspect ratios less than 0.5 or greater than 2.0, and set the short side of the training images to 800 pixels. The long side is automatically adjusted according to the aspect ratio. The position of the target in the training images is also adjusted according to the aspect ratio.
[0013] Step 1.2: Input the preprocessed training image into the feature pyramid backbone network, and extract multi-scale features through multi-layer convolution, activation and pooling operations.
[0014] Step 1.3: For each scale of the multi-scale features, first perform a 3×3 convolution operation, and then use three 1×1 convolutional layers to obtain three feature maps respectively. Based on the position of each pixel in the feature map, predict the score, distance and angle of the ground truth box to obtain the score of the predicted coarse directed box, the position to the four borders of the coarse directed box and the angle of the coarse directed box. Combine the predicted angle and distance to obtain the coarse directed candidate box.
[0015] Preferably, the coarse directed candidate box generation module is optimized using backpropagation and stochastic gradient descent, and the loss function of the coarse directed candidate box generation module is:
[0016] ,
[0017] and ;
[0018] ;
[0019] ;
[0020] in, and These represent the probability that a training sample in a training image is predicted as the target and the corresponding binary true label, respectively. Represents the binary classification loss function; and The table shows the approximate distances from the center point of the candidate bounding box to its four sides, and the actual distances from the center point of the ground truth bounding box labeled on the training samples of the training image to its four borders, respectively. and These represent the angles of the roughly directed candidate box and the ground truth box, respectively. and These represent the number of training samples and the number of positive samples in the training samples, respectively. and Let L1 represent the distance and angle loss functions, respectively.
[0021] Preferably, the method for training the fine-grained directed candidate box generation module is as follows:
[0022] Step 2.1: Perform an alignment convolution on the input coarsely directed candidate boxes to obtain alignment features;
[0023] Step 2.2: The generated alignment features are processed by two 1×1 convolutional layers to obtain an H×W×1 feature map and an H×W×5 feature map. The H×W×1 feature map is used to predict the probability that the fine directed candidate box is the foreground, and the H×W×5 feature map is used to predict the width, height, center point and angle of the coarse directed candidate box to obtain the fine directed candidate box.
[0024] Preferably, the loss function of the refined directed candidate box generation module is:
[0025] ;
[0026] in, This represents the probability that the fine-directed candidate box predicted by the classification branch of the fine-directed candidate box is foreground. A binary label is assigned to each candidate box in a rough manner; Let represent the binary classification loss function, and:
[0027] ;
[0028] Focus rotation crossover ratio regression loss function for:
[0029] ;
[0030] in, and These represent fine-grained directed candidate boxes and ground truth boxes labeled with training samples in the training images, respectively. This represents the focus rotation intersection-union ratio regression loss function. These are hyperparameters used to control the rate of gradient change. Representing fine-grained directed candidate boxes and real frame The rotational intersection ratio.
[0031] Preferably, the rotational crossover ratio for:
[0032] ;
[0033] ;
[0034] in, and These represent fine-grained directed candidate boxes. and real frame The center point; Indicates the center point and Euclidean distance; , ), ( , )and( , ) represent fine-grained directed candidate boxes. minimum horizontal bounding rectangle Realistic frame Horizontal minimum outer rectangle as well as and The horizontal minimum bounding rectangle Width and height; d s It is the smallest horizontal bounding rectangle The length of the diagonal. and These represent fine-grained directed candidate boxes. The minimum horizontal bounding rectangle and real frame The horizontal minimum bounding rectangle The midpoint of the top border; and These represent the minimum horizontal bounding rectangles respectively. and the horizontal minimum bounding rectangle The midpoint of the right frame; and These represent the minimum horizontal bounding rectangles, respectively. With fine-grained directed candidate boxes The intersection of the top border and the right border. and These represent the minimum horizontal bounding rectangles respectively. With real frame The intersection of the top and right borders; a coordinate system is formed with the top left corner of the input high-resolution remote sensing image as the origin, the top border as the positive x-axis, and the left border as the positive y-axis. Indicates the midpoint The x-axis coordinate; Intersection The x-axis coordinate; Intersection The x-axis coordinate; Midpoint The x-axis coordinate; Midpoint y-axis coordinate; Intersection y-axis coordinate; Midpoint The y-axis coordinate; Intersection The y-axis coordinate; Indicates the intersection point Relative to the midpoint The offset; Indicates the intersection point Relative to the midpoint The offset; Intersection Offset from the midpoint; Intersection Relative to the midpoint The offset; Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The horizontal minimum bounding rectangle The intersection and union ratio.
[0035] Preferably, the rotational crossover ratio The calculation method is as follows:
[0036] The existing rectangular bounding box regression loss function, suitable for horizontal object detection, is transformed into a rotation intersection-union (RIoU) loss function suitable for oriented object detection. for: ;
[0037] in, and The regression loss functions represent the minimum horizontal bounding rectangles of the refined directed candidate boxes and the ground truth boxes, and the offsets, respectively; the offset regression loss function. The expression is:
[0038] ;
[0039] Regression loss of the horizontal minimum bounding rectangle for:
[0040] ;
[0041] ;
[0042] in, Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The area of the intersection region, express and The area of the union region, Represents the minimum horizontal bounding rectangle and the horizontal minimum bounding rectangle The intersection and union ratio;
[0043] Then RIOU loss function for:
[0044] ;
[0045] Then the rotation-intersection-union ratio is:
[0046] .
[0047] Preferably, the loss function of the region detection module is:
[0048] ;
[0049] in, and These represent the predicted scores and corresponding classification labels of the candidate bounding boxes, respectively. and These represent the predicted bounding box and the corresponding ground truth bounding box of the candidate object, respectively. and These represent the multi-class classification loss function and the bounding box regression loss function, respectively. Indicates the weighting parameter;
[0050] The multi-class classification loss function is: ;
[0051] in, Indicates the index of the candidate target box. Indicates the number of target categories. and They represent the first The candidate bounding box was predicted as the [number]th [position]. The probability of a class and its corresponding label;
[0052] Boundary regression loss function The focus rotation intersection-union ratio regression loss function is adopted, and:
[0053] ;
[0054] in, These represent the final predicted bounding box and the ground truth bounding box, respectively. Represents the prediction box and real frame The focal rotation intersection ratio.
[0055] Preferably, the method of the training region detection module is as follows:
[0056] Step 3.1: Remove fine-grained directed candidate boxes that exceed the boundary. Calculate the score of the remaining fine-grained directed candidate boxes using a softmax classifier and filter out fine-grained directed candidate boxes with scores lower than a set threshold of 0.05. Perform non-maximum suppression on the remaining fine-grained directed candidate boxes based on the scores, and select 2000 fine-grained directed candidate boxes as candidate target boxes from high to low scores.
[0057] Step 3.2: Map the obtained candidate bounding boxes onto a feature map of a certain scale:
[0058] ;
[0059] in, and These represent the width and height of the candidate bounding box, respectively. This indicates the scale order of the feature maps to which they are mapped. express The scale order of the feature maps to which the candidate bounding boxes are mapped. This indicates rounding down to the nearest integer.
[0060] Step 3.3: Map the candidate bounding boxes to the same relative positions on feature maps of other scales to obtain the region of interest;
[0061] Step 3.4: Based on the obtained regions of interest, pooling is performed on the regions of interest in the multi-layer feature maps respectively; a 7×7 convolution operation is performed on the feature maps obtained after pooling the regions of interest to obtain a one-dimensional feature vector FC1; a fully connected operation is performed on the feature vector FC1 to obtain a one-dimensional feature vector FC2; two fully connected layers are obtained based on the feature vector FC2; a feature vector of C dimensions with the number of classes is connected after the second fully connected layer; finally, a softmax classifier is used to classify the C-dimensional feature vector, and the class with the highest score is regarded as the target class; a 5C-dimensional feature vector is connected after the second fully connected layer, and the 5C-dimensional feature vector represents the coordinates of the target's location.
[0062] Preferably, the training of the coarse directed candidate box generation module is performed in multiple feature layers; the feature extraction network of the coarse directed candidate box generation module adopts a deep model pre-trained on ImageNet, and the remaining network parameters of the coarse directed candidate box generation module are randomly initialized according to a Gaussian distribution with a mean of 0 and a variance of 0.01.
[0063] The binary label d*∈{0,1} of each coarsely directed candidate box is assigned by calculating the intersection-union ratio (IoU) between the coarsely directed candidate box and the ground truth box. If the IoU between the coarsely directed candidate box and the ground truth box is higher than 0.7, it is considered a positive sample with a binary label of 1, while if the IoU between the coarsely directed candidate box and the ground truth box is lower than 0.3, it is considered a negative sample with a binary label of 0.
[0064] The beneficial effects of this invention are as follows: This invention proposes a unified strategy for transferring bounding box regression loss from horizontal object detection to directed object detection, providing a general solution to facilitate the transfer of bounding box regression loss from horizontal object detection to directed object detection. Then, by transferring the efficient cross-union ratio (CUD) loss from horizontal object detection, a rotating CUD loss is designed for bounding box regression in directed object detection. In fact, other bounding box regression losses from horizontal object detection can also be transferred to directed object detection according to this unified strategy; the rotating CUD loss can be used as an example to illustrate how this transfer works. Based on the rotating CUD loss, a new bounding box regression loss and a focus rotating CUD loss are proposed to assign greater weights to hard samples in bounding box regression processing. Comparison with existing bounding box regression losses shows that the rotating CUD loss and focus rotating CUD loss proposed in this invention provide better performance, enabling more accurate localization of the object detection model. Attached Figure Description
[0065] 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is a flowchart of the present invention.
[0067] Figure 2 This is a schematic diagram of the unified porting strategy of this invention.
[0068] Figure 3 This is a schematic diagram of the intersection rotation loss of the present invention, wherein (a) is the predicted box and its horizontal minimum bounding rectangle, (b) is the true box and its horizontal minimum bounding rectangle, and (c) is the horizontal bounding rectangle of the horizontal minimum bounding rectangle of the predicted box and the true box.
[0069] Figure 4 This is a comparison chart of the DOTA simulation dataset used in this invention.
[0070] Figure 5 This is a simulation comparison chart of the present invention on the DIOR-R dataset. Detailed Implementation
[0071] 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. 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.
[0072] like Figure 1 As shown, a directed object detection method based on focus rotation intersection-union ratio bounding box regression loss has the following steps:
[0073] Step 1: Use labeled high-resolution remote sensing images as training images to train a coarse directed candidate box generation module; the loss function of the coarse directed candidate box generation module is the joint loss of the binary classification loss function and the bounding box regression loss function.
[0074] The training of the coarse directed candidate box generation module is performed on multiple feature layers. The feature extraction network of the coarse directed candidate box generation module uses a deep model pre-trained on ImageNet. This improves model performance because these models have learned rich image features and have good generalization performance, enabling effective feature extraction and representation on different image datasets. The remaining network parameters of the coarse directed candidate box generation module are randomly initialized using a Gaussian distribution with a mean of 0 and a variance of 0.01. Random initialization using a Gaussian distribution increases model diversity and avoids the problem of excessively large or small initial weights. Furthermore, training on a pre-trained model improves model accuracy and training efficiency.
[0075] The method for training a rough candidate box generation module is as follows:
[0076] Step 1.1: Use labeled high-resolution remote sensing images as training images. Preprocess the training images and target locations according to aspect ratio: Discarding images in the high-resolution remote sensing image dataset that do not contain valid targets can improve the model's performance in valid target detection. The labeled high-resolution remote sensing images are used as training images and sorted according to aspect ratio from smallest to largest. The aspect ratio of the sample images is limited to between 0.5 and 2.0. Cropping sample images with aspect ratios less than 0.5 or greater than 2.0 can reduce the computational load of the model and speed up training. The shorter side of the image is set to 800 pixels, and the longer side is automatically adjusted according to the aspect ratio to unify the size of the sample images, which is beneficial for model training and optimization. The target positions in the training images are also adjusted according to the aspect ratio to improve the accuracy of target localization in the image, thereby improving the model's detection accuracy.
[0077] Both training and test images are labeled high-resolution remote sensing images. The high-resolution remote sensing image datasets used in this invention are DOTA (Xia GS, Bai X, Ding J, et al. DOTA: A large-scale dataset for object detection in aerial images[C] / / Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 3974-3983.) and DIOR-R (G. Cheng et al., "Anchor-Free Oriented Proposal Generator for ObjectDetection," in IEEE Transactions on Geoscience and Remote Sensing, vol. 60,pp. 1-11, 2022, Art no. 5625411.). In the DOTA dataset, there are 1411 training images, 458 validation images, and 937 test images; a total of 15 target classes are included, and each image size is 800×800~4000×4000 pixels. In this invention, training and validation images are used to train the object detection model, and test images are used to test the object detection model. The DIOR-R dataset contains 20 object classes, with each image being 800×800 pixels. The training, validation, and test images comprise 5862, 5863, and 11738 images, respectively. In this invention, the training and validation sets are used to train the object detection model, and the test set is used to test the object detection model.
[0078] Step 1.2: Input the preprocessed training image into the feature pyramid backbone network, and extract multi-scale features through multi-layer convolution, activation and pooling operations.
[0079] In practical implementation, it can be achieved using the method described in the literature [Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 2117-2125]. Feature pyramid networks can utilize features from multiple scales simultaneously, achieving better object detection results.
[0080] Step 1.3: For each scale of the multi-scale features, a 3×3 convolution operation is first performed, followed by three 1×1 convolutional layers to obtain three feature maps. The sizes of the feature maps are H×W×1, H×W×4, and H×W×1, respectively, where H and W represent the height and width of the feature map at that scale. This means that for each pixel, the score, distance, and angle of the corresponding ground truth bounding box are predicted, resulting in the score of the predicted coarse directed box, its position relative to the four borders of the coarse directed box, and the angle of the coarse directed box. The predicted angles and distances are combined to obtain coarse directed candidate boxes. The coarse directed candidate box generation module is then optimized using backpropagation and stochastic gradient descent based on the offset from the ground truth bounding box. First, the gradient is calculated through backpropagation, and then the model parameters are updated using optimization methods such as stochastic gradient descent. The loss function of the coarse directed candidate box generation module is the joint loss of the binary classification loss function and the bounding box regression loss function. The loss function of the coarse directed candidate box generation module is:
[0081] ,
[0082] and ;
[0083] ;
[0084] ;
[0085] in, and These represent the probability that a training sample in a training image is predicted as the target and the corresponding binary true label, respectively. Represents the binary classification loss function; and The table shows the approximate distance from the center point of the candidate bounding box to its four sides, and the actual distance from the center point of the ground truth bounding box labeled with the training samples in the training image of the dataset to its four sides. and These represent the angles of the roughly directed candidate box and the ground truth box, respectively. and These represent the number of training samples and the number of positive samples in the training samples, respectively. and Let L1 represent the distance and angle loss functions, respectively.
[0086] Step 2: Feed the coarsely directed candidate boxes generated by the trained coarsely directed candidate box generation module into the finely directed candidate box generation module to train the finely directed candidate box generation module.
[0087] The training of the fine-grained directed candidate box generation module is as follows: First, a binary label d*∈{0,1} is assigned to each coarse-grained directed candidate box. Here, 0 and 1 represent whether the label belongs to a positive or negative sample, respectively. The label is assigned by calculating the intersection-over-union (IoU) ratio between the coarse-grained candidate box and the ground truth box. If the IoU between the coarse-grained candidate box and the ground truth box is higher than 0.7, it is considered a positive sample and labeled 1; if it is lower than 0.3, it is considered a negative sample and labeled 0; otherwise, it is ignored.
[0088] The implementation methods for training a fine-grained directed candidate box generation module include:
[0089] Step 2.1: Perform an alignment convolution on the input coarsely directed candidate boxes to obtain aligned features. The main part of the alignment convolution is a deformable convolutional layer that aligns the input features under the guidance of the offset domain. Unlike ordinary deformable convolution, the alignment convolution uses a small network to generate an offset field, restricting the sampling points of the alignment convolution to within the generated coarsely directed candidate boxes. Alignment convolution is a convolutional operation that can dynamically adjust the shape of the convolution kernel according to the coarsely directed candidate boxes, thereby improving feature representation capabilities and increasing the receptive field.
[0090] Step 2.2: The generated aligned features are processed by two 1×1 convolutional layers to obtain an H×W×1 feature map and an H×W×5 feature map. The H×W×1 feature map is mainly used to predict the probability that the fine-grained directed candidate box is the foreground, while the H×W×5 feature map predicts the width, height, center point, and angle of the coarse-grained directed candidate box to obtain the fine-grained directed candidate box. This invention optimizes the fine-grained directed candidate box generation module by using backpropagation and stochastic gradient descent based on the offset from the ground truth box. First, the gradient is calculated through backpropagation, and then the model parameters are updated using optimization methods such as stochastic gradient descent.
[0091] The loss function during training of the fine-grained directed candidate box generation module can be defined as:
[0092] ;
[0093] in, and and represent the probability that the fine-directed candidate box predicted by the classification branch of the fine-directed candidate box is the foreground and the binary label assigned to each coarse-directed candidate box, respectively. Denotes the binary classification loss function, and
[0094] ;
[0095] The loss function is the focus rotation cross-union regression loss function. The definition is as follows:
[0096] ;
[0097] in, and These represent fine-grained directed candidate boxes and ground truth bounding boxes labeled with training samples in the training images of the dataset, respectively. The rotation-intersection-union ratio (RIoU) regression loss function increases the relative weight of the loss for hard samples in the overall loss, thereby improving object detection accuracy. Hard samples are training samples that differ significantly from the ground truth bounding boxes. The gradient of the loss function is obtained by taking the derivative of the loss function. The absolute value of the gradient gradually increases as the RIoU decreases. In other words, hard samples (i.e., the larger the difference in RIoU between the fine-grained directed candidate boxes and the ground truth boxes, the more difficult the training samples) receive more attention, thus improving model performance. These are hyperparameters used to control the rate of gradient change; here, we take... , Representing fine-grained directed candidate boxes and real frame The rotational intersection ratio.
[0098] like Figure 2 and Figure 3 As shown, rotational intersection ratio for:
[0099] ;
[0100] ;
[0101] in, and These represent fine-grained directed candidate boxes. and real frame The center point; Indicates the center point and Euclidean distance; , ), ( , )and( , ) represent fine-grained directed candidate boxes. minimum horizontal bounding rectangle Fine-grained directed candidate boxes Horizontal minimum outer rectangle as well as and The minimum horizontal bounding rectangle Width and height; d s It is the smallest horizontal bounding rectangle The length of the diagonal. and These represent fine-grained directed candidate boxes. The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The midpoint of the top border; and These represent fine-grained directed candidate boxes. The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The midpoint of the right frame; and Represents the minimum horizontal bounding rectangle With fine-grained directed candidate boxes The intersection of the top border and the right border. and Represents the minimum horizontal bounding rectangle With real frame The intersection of the top and right borders; a coordinate system is formed with the top left corner of the input high-resolution remote sensing image as the origin, the top border as the positive x-axis, and the left border as the positive y-axis. Indicates the midpoint The x-axis coordinate; Corner point The x-axis coordinate; Intersection The x-axis coordinate; Midpoint The x-axis coordinate; Midpoint The y-axis coordinate; Intersection y-axis coordinate; Midpoint The y-axis coordinate; Intersection The y-axis coordinate; Indicates the intersection point Relative to the midpoint The offset; Indicates the intersection point Relative to the midpoint The offset; Intersection Offset from the midpoint; Intersection Relative to the midpoint The offset.
[0102] Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The intersection and union ratios, and:
[0103] ;
[0104] Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The area of the intersection region, Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle ;
[0105] like Figure 2 The calculation method for the rotation intersection-union ratio is as follows: the regression problem of the directed rectangle is transformed into a joint regression problem of its horizontal minimum bounding rectangle and two offsets, that is: Figure 1 As shown, firstly, based on the directed rectangle... Construct its minimum horizontal bounding rectangle. , Vertex and The intersection of the top border Compared to Midpoint of top border offset used express, Vertex and right frame intersection Compared to Right side box offset used This indicates. The regression problem can be transformed into , and The issue of joint regression.
[0106] Following the above approach, this invention transforms the existing rectangular bounding box regression loss function suitable for horizontal target detection into a rotation intersection-union (RIoU) loss function suitable for directed target detection. RIoU Loss Function The general expression is:
[0107] ;
[0108] in, and These represent the regression loss functions for the minimum horizontal bounding rectangles and offsets of the refined directed candidate boxes and the ground truth boxes, respectively. Combined with... Figure 2 The regression loss function of offset The expression is as follows:
[0109] ;
[0110] EIoU Loss (Y.-F. Zhang et al., “Focal and efficient iou loss for accurate bounding box regression,” Neurocomputing, vol. 506, pp. 146–157, 2022.) was chosen as the regression loss for the horizontal minimum bounding rectangle. , combined Figure 2 Regression loss of the minimum horizontal bounding rectangle The expression is:
[0111] ;
[0112] ;
[0113] in, Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The area of the intersection region, express and The area of the union region, express and The intersection and union ratio, and These represent fine-grained directed candidate boxes. and real frame The center point, ( , ), ( , ) and( , ) represent fine-grained directed candidate boxes. The minimum horizontal bounding rectangle Realistic frame The minimum horizontal bounding rectangle and ( , The width and height of the minimum horizontal bounding rectangle. It's worth noting that EIoU Loss is not... The only option is any regression loss function suitable for horizontal target detection. The choice of [the appropriate factor] allows for the derivation of the loss function. The detailed expression is:
[0114] ;
[0115] The expression for the rotational intersection-union ratio is:
[0116] .
[0117] By training the fine-grained directed candidate box module, fine-grained directed candidate boxes with more accurate localization can be obtained.
[0118] Step 3: Training the Region Detection Module: The region detection module is trained using fine-grained directed candidate boxes as candidate target boxes. The region detection module uses the focal rotation intersection-union regression loss function.
[0119] The implementation methods for the training region detection module include:
[0120] Step 3.1: After the fine-grained directed candidate box generation module generates high-quality fine-grained directed candidate boxes, since these boxes generally have high overlap, we first remove anchor boxes that exceed the boundaries. Then, we use a softmax classifier to calculate the scores of the remaining fine-grained directed candidate boxes, filtering out those with scores below a set threshold of 0.05. Next, we perform non-maximum suppression on the remaining fine-grained directed candidate boxes based on their scores. Finally, based on the non-maximum suppression operation, we select 2000 fine-grained directed candidate boxes from high to low scores as candidate target boxes. This reduces the number of boxes that need to be processed in object detection, thereby improving detection efficiency and accuracy. By removing low-scoring anchor boxes and performing non-maximum suppression, the number of fine-grained directed candidate boxes that need to be processed can be reduced to a certain extent without affecting the detection results, reducing the computational and storage burden.
[0121] Nonmaximum suppression can be implemented using the literature [Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semanticsegmentation. In Proceedings of Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 580-587].
[0122] Step 3.2: Map the candidate target boxes obtained in Step 3.1 onto a feature map of a certain scale. The specific implementation method is as follows:
[0123] ;
[0124] in, and These represent the width and height of the candidate bounding box, respectively. This indicates the scale order of the feature maps to which they are mapped, and the number of maps mapped to the first feature map. On feature maps of various scales express The order in which the candidate bounding boxes are mapped to the feature maps. This invention uses an input layer size of... The convolutional neural network serves as the backbone network. This indicates rounding down to the nearest integer.
[0125] Step 3.3: After determining the scale order of the feature maps to which the candidate target boxes are mapped, map the candidate target boxes to the same relative positions on feature maps of other scales to obtain the region of interest.
[0126] Step 3.4: Based on the regions of interest obtained in Step 3.3, pooling is performed on the regions of interest in the multi-layer feature maps. Region of interest pooling can be implemented using the method described in the literature [He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask r-cnn. In Proceedings of Proceedings of the IEEE internationalconference on computer vision; pp. 2961-2969]. The purpose of region of interest pooling is to map candidate bounding boxes of different sizes onto a feature map of a fixed size, so as to extract features and classify the candidate bounding boxes.
[0127] The feature map obtained after region-of-interest pooling is subjected to a 7×7 convolution operation to obtain a one-dimensional feature vector FC1. Then, a fully connected operation is performed on the feature vector FC1 to obtain a one-dimensional feature vector FC2. Based on the feature vector FC2, two fully connected layers are obtained. After the second fully connected layer, a C-dimensional feature vector (C represents the number of classes) is connected. Finally, a softmax classifier is used to classify the C-dimensional feature vector, and the class with the highest score is regarded as the target class. After the second fully connected layer, a 5C-dimensional feature vector (one bounding box is predicted for each class) is connected. This 5C-dimensional feature vector represents the coordinates of the target's location.
[0128] The loss function for the region detection module is as follows:
[0129] ;
[0130] in, and These represent the predicted score and corresponding classification label of the candidate bounding box, respectively. and These represent the predicted bounding box and the corresponding ground truth bounding box of the candidate object, respectively. and These represent the multi-class classification loss function and the bounding box regression loss function, respectively. This represents the weight parameter, which is set to 10 here.
[0131] The multi-class classification loss function is calculated as follows:
[0132] ;
[0133] in, Indicates the index of the candidate target box. Indicates the number of target categories. and They represent the first The candidate bounding box was predicted as the [number]th [position]. The probability of a class and its corresponding label.
[0134] Boundary regression loss function The focus rotation crossover ratio regression loss function is defined as follows:
[0135] ;
[0136] in, These represent the final predicted bounding box and the ground truth bounding box, respectively. Represents the prediction box and real frame The focal rotation intersection ratio.
[0137] The model employed uses an end-to-end training approach, which optimizes the entire model's parameters, thereby improving its performance. The model's total loss function is:
[0138] ;
[0139] The coarse directed box candidate module, the fine candidate module, and the region detection module are simultaneously trained iteratively until convergence.
[0140] Step 4: Testing Phase: The high-resolution remote sensing image to be detected is input into the target detection model, which consists of a coarse directed candidate box generation module, a fine directed candidate box generation module, and a region detection module, after training. This process obtains the location and category of the target of interest (ROI) in the high-resolution remote sensing image. The high-resolution remote sensing image to be detected comes from the DOTA and DIOR-R datasets. The location of the ROI represents the coordinates of the target's compact closed bounding box in the image. The coordinate system has the top-left corner of the image as the origin, the horizontal direction to the right as the x-axis, and the vertical direction downwards as the y-axis. The category indicates which class the target belongs to (e.g., aircraft).
[0141] High-resolution remote sensing images are fed into the region detection module. Through multi-layer convolution, pooling, and activation operations, two fully connected layers are formed. A C-dimensional feature vector (C represents the number of classes) is connected after the second fully connected layer. Finally, a softmax classifier is used to classify the C-dimensional feature vector, and the class with the highest score is regarded as the target class. A 5C-dimensional feature vector (predicting a bounding box for each class) is connected after the second fully connected layer. This 5C-dimensional feature vector represents the coordinates of the target's location.
[0142] To verify the detection accuracy of this invention, all experiments were conducted on mmdetection within the PyTorch framework, running on a system with two Intel(R) Xeon(R) CPUs E5-2630 v4 (10×2 cores total, 2.20GHz), 256GB of RAM, and one NVIDIA GeForce RTX 2080Ti graphics card. The experimental results are as follows:
[0143] As shown in Table 1, the original Smooth L1 regression loss function of AOPG (Cheng G, Wang J, Li K, et al. Anchor-free oriented proposal generator for object detection[J]. IEEE Transactions on Geoscience and Remote Sensing, 2022, 60: 1-11.) was replaced with the focus rotation intersection-union ratio regression loss function proposed in this invention. Compared with the Smooth L1 regression loss function, the mAP (Mean Average Precision) of this invention increased by 3.49% and 1.69% on the DOTA and DIOR-R datasets, respectively, thus verifying the superiority of the focus rotation intersection-union ratio regression loss function proposed in this invention.
[0144] Table 1 Detection results of DOTA and DIOR-R high-resolution remote sensing images
[0145]
[0146] Figure 4 and Figure 5 These are subjective comparison graphs of the proposed focus rotation intersection-union ratio regression loss function and the Smooth L1 regression loss function for object detection on the DOTA and DIOR-R datasets. The graphs clearly show that the directional object detection method proposed in this invention has superior localization performance, proving that the focus rotation intersection-union ratio regression loss function is more accurate in localization than the existing bounding box regression loss function.
[0147] 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 principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A directed target detection method based on focus rotation intersection-union ratio bounding box regression loss, characterized in that, The steps are as follows: Step 1: Using labeled high-resolution remote sensing images as training images, train a coarse directed candidate box generation module; the loss function of the coarse directed candidate box generation module is the joint loss of the binary classification loss function and the bounding box regression loss function. Step 2: Feed the coarse directed candidate boxes generated by the trained coarse directed candidate box generation module into the fine directed candidate box generation module, and train the fine directed candidate box generation module using the focus rotation intersection-union regression loss function. Step 3: Training the region detection module: The region detection module is trained using fine-grained directed candidate boxes as candidate target boxes; the region detection module uses the focal rotation intersection-union regression loss function as the bounding box regression loss function. Step 4: The trained coarse directed candidate box generation module, fine directed candidate box generation module, and region detection module form the target detection model. The high-resolution remote sensing image to be detected is input into the target detection model to obtain the location and category of the target of interest in the high-resolution remote sensing image to be detected. The loss function of the refined directed candidate box generation module is: ; in, This represents the probability that the fine-directed candidate box predicted by the classification branch of the fine-directed candidate box is foreground. A binary label is assigned to each candidate box in a rough manner; Let represent the binary classification loss function, and: ; Focus rotation crossover ratio regression loss function for: ; in, and These represent fine-grained directed candidate boxes and ground truth boxes labeled with training samples in the training images, respectively. This represents the focus rotation intersection-union ratio regression loss function. These are hyperparameters used to control the rate of gradient change. Representing fine-grained directed candidate boxes and real frame The rotational intersection ratio.
2. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 1, characterized in that, The method for training the coarse directed candidate box generation module is as follows: Step 1.1: Preprocess the training images and target locations according to aspect ratio: Sort the training images according to aspect ratio from smallest to largest. The aspect ratio of the training images is limited to between 0.5 and 2.
0. Crop the training images with aspect ratios less than 0.5 or greater than 2.0, and set the short side of the training images to 800 pixels. The long side is automatically adjusted according to the aspect ratio. The position of the target in the training images is also adjusted according to the aspect ratio. Step 1.2: Input the preprocessed training image into the feature pyramid backbone network, and complete the feature extraction through multi-layer convolution, activation and pooling operations to obtain multi-scale features; Step 1.3: For each scale of the multi-scale features, first perform a 3×3 convolution operation, and then use three 1×1 convolutional layers to obtain three feature maps respectively. Based on the position of each pixel in the feature map, predict the score, distance and angle of the ground truth box to obtain the score of the predicted coarse directed box, the position to the four borders of the coarse directed box and the angle of the coarse directed box. Combine the predicted angle and distance to obtain the coarse directed candidate box.
3. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 1 or 2, characterized in that, The coarse directed candidate box generation module is optimized using backpropagation and stochastic gradient descent, and its loss function is as follows: , and ; ; ; in, and These represent the probability that a training sample in a training image is predicted as the target and the corresponding binary true label, respectively. Represents the binary classification loss function; and These represent the approximate distances from the center point of the directed candidate box to its four sides, and the actual distances from the center point of the ground truth box labeled on the training samples of the training image to its four borders, respectively. and These represent the angles of the roughly directed candidate box and the ground truth box, respectively. and These represent the number of training samples and the number of positive samples in the training samples, respectively. and Let L1 represent the distance and angle loss functions, respectively.
4. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 3, characterized in that, The method for training the fine-grained directed candidate box generation module is as follows: Step 2.1: Perform an alignment convolution on the input coarsely directed candidate boxes to obtain alignment features; Step 2.2: The generated alignment features are processed by two 1×1 convolutional layers to obtain an H×W×1 feature map and an H×W×5 feature map. The H×W×1 feature map is used to predict the probability that the fine directed candidate box is the foreground, and the H×W×5 feature map is used to predict the width, height, center point and angle of the coarse directed candidate box to obtain the fine directed candidate box.
5. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 4, characterized in that, The rotational crossover ratio for: ; ; in, and These represent fine-grained directed candidate boxes. and real frame The center point; Indicates the center point and Euclidean distance; , ), ( , )and( , ) represent fine-grained directed candidate boxes. minimum horizontal bounding rectangle Realistic frame Horizontal minimum outer rectangle as well as and The minimum horizontal bounding rectangle Width and height; d s It is the smallest horizontal bounding rectangle The length of the diagonal; and These represent fine-grained directed candidate boxes. The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The midpoint of the top border; and These represent the minimum horizontal bounding rectangles, respectively. and the horizontal minimum bounding rectangle The midpoint of the right frame; and These represent the minimum horizontal bounding rectangles, respectively. With fine-grained directed candidate boxes The intersection of the top border and the right border. and These represent the minimum horizontal bounding rectangles, respectively. With real frame The intersection of the top and right borders; a coordinate system is formed with the top left corner of the input high-resolution remote sensing image as the origin, the top border as the positive x-axis, and the left border as the positive y-axis. Indicates the midpoint The x-axis coordinate; Intersection The x-axis coordinate; Intersection The x-axis coordinate; Midpoint The x-axis coordinate; Midpoint y-axis coordinate; Intersection y-axis coordinate; Midpoint y-axis coordinate; Intersection The y-axis coordinate; Indicates the intersection point Relative to the midpoint The offset; Indicates the intersection point Relative to the midpoint The offset; Intersection Offset from the midpoint; Intersection Relative to the midpoint The offset; Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The intersection and union ratio.
6. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 5, characterized in that, The rotational crossover ratio The calculation method is as follows: The existing rectangular bounding box regression loss function, suitable for horizontal object detection, is transformed into a rotation intersection-union (RIoU) loss function suitable for oriented object detection. for: ; in, and The regression loss functions represent the minimum horizontal bounding rectangles of the refined directed candidate boxes and the ground truth boxes, and the offsets, respectively; the offset regression loss function. The expression is: ; Regression loss of the horizontal minimum bounding rectangle for: ; ; in, Representing fine-grained directed candidate boxes The minimum horizontal bounding rectangle and real frame The minimum horizontal bounding rectangle The area of the intersection region, Represents the minimum horizontal bounding rectangle and the horizontal minimum bounding rectangle The area of the union region, Represents the minimum horizontal bounding rectangle and the horizontal minimum bounding rectangle The intersection and union ratio; Then the RIOU loss function for: ; Then the rotation-intersection-union ratio is: 。 7. The directed target detection method based on focal rotation intersection-union ratio bounding box regression loss according to claim 5 or 6, characterized in that, The loss function of the region detection module is: ; in, and These represent the predicted score and corresponding classification label of the candidate bounding box, respectively. and These represent the predicted bounding box and the corresponding ground truth bounding box of the candidate object, respectively. and These represent the multi-class classification loss function and the bounding box regression loss function, respectively. Indicates the weighting parameter; The multi-class classification loss function is: ; in, Indicates the index of the candidate target box. Indicates the number of target categories. and They represent the first The candidate bounding box was predicted as the [number]th [number]. The probability of a class and its corresponding label; Boundary regression loss function The focus rotation intersection-union ratio regression loss function is adopted, and: ; in, These represent the final predicted bounding box and the ground truth bounding box, respectively. Represents the prediction box and real frame The focal rotation intersection ratio.
8. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 7, characterized in that, The method of the training region detection module is as follows: Step 3.1: Remove fine-grained directed candidate boxes that exceed the boundary. Calculate the score of the remaining fine-grained directed candidate boxes using a softmax classifier and filter out fine-grained directed candidate boxes with scores lower than a set threshold of 0.
05. Perform non-maximum suppression on the remaining fine-grained directed candidate boxes based on the scores, and select 2000 fine-grained directed candidate boxes as candidate target boxes from high to low scores. Step 3.2: Map the obtained candidate bounding boxes onto a feature map of a certain scale: ; in, and These represent the width and height of the candidate bounding box, respectively. This indicates the scale order of the feature maps to which they are mapped. express The scale order of the feature maps to which the candidate bounding boxes are mapped. Indicates rounding down; Step 3.3: Map the candidate bounding boxes to the same relative positions on feature maps of other scales to obtain the region of interest; Step 3.4: Based on the obtained regions of interest, pooling is performed on the regions of interest in the multi-layer feature maps respectively; a 7×7 convolution operation is performed on the feature maps obtained after pooling the regions of interest to obtain a one-dimensional feature vector FC1; a fully connected operation is performed on the feature vector FC1 to obtain a one-dimensional feature vector FC2; two fully connected layers are obtained based on the feature vector FC2; a feature vector of C dimensions with the number of classes is connected after the second fully connected layer; finally, a softmax classifier is used to classify the C-dimensional feature vector, and the class with the highest score is regarded as the target class; a 5C-dimensional feature vector is connected after the second fully connected layer, and the 5C-dimensional feature vector represents the coordinates of the target's location.
9. The directed target detection method based on focus rotation intersection-union ratio bounding box regression loss according to claim 8, characterized in that, The training of the coarse directed candidate box generation module is carried out in multiple feature layers; the feature extraction network of the coarse directed candidate box generation module adopts a deep model pre-trained on ImageNet, and the other network parameters of the coarse directed candidate box generation module are randomly initialized according to a Gaussian distribution with a mean of 0 and a variance of 0.
01. The binary label d*∈{0,1} of each coarsely directed candidate box is assigned by calculating the intersection-union ratio of the coarsely directed candidate box and the ground truth box. If the IoU between the coarsely directed candidate box and the ground truth box is higher than 0.7, it is considered a positive sample with a binary label of 1. If the IoU between the coarsely directed candidate box and the ground truth box is lower than 0.3, it is considered a negative sample with a binary label of 0.
Citation Information
Patent Citations
Remote sensing image target detection method based on new frame regression loss function
CN111091105A
