T HE KFI O U L OSS FOR R OTATED O BJECT D ETECTION
Anonymous authors
Paper under double-blind review A BSTRACT
Differing from the well-developed horizontal object detection area whereby the computing-friendly IoU based loss is readily adopted and well fits with the detection metrics.
In contrast, rotation detectors often involve a more complicated loss based on SkewIoU which is unfriendly to gradient-based training.
In this paper, we propose an effective approximate SkewIoU loss based on Gaussian modeing and Kalman filter, which mainly consists of two items.
The first term is a scaleinsensitive center point loss, which is used to quickly get the center points between bounding boxes closer to assist the second term.
In the distance-independent second term, Kalman filter is adopted to inherently mimic the mechanism of SkewIoU by its definition, and show its alignment with the SkewIoU loss at trend-level within a certain distance (i.e. within 9 pixels).
This is in contrast to recent Gaussian modeling based rotation detectors e.g. GWD loss and KLD loss that involve a human-specified distribution distance metric which require additional hyperparameter tuning that vary across datasets and detectors.
The resulting new loss called KFIoU loss is easier to implement and works better compared with exact
SkewIoU loss, thanks to its full differentiability and ability to handle the nonoverlapping cases.
We further extend our technique to the 3-D case which also suffers from the same issues as 2-D detection.
Extensive results on various public datasets (2-D/3-D, aerial/text/face images) with different base detectors show the effectiveness of our approach.
The code will be made publicly available.
I NTRODUCTION
Rotated object detection is an relatively emerging but challenging area, due to the difficulties of locating the arbitrary-oriented objects and separating them effectively from the background, such as aerial images (Yang et al., 2018a;
Ding et al., 2019; Yang et al., 2018b;
Yang & Yan, 2022), scene text (Jiang et al., 2017; Zhou et al., 2017; Ma et al., 2018).
Though considerable progresses have been recently made, for practical settings, there still exist challenges for rotating objects with large aspect ratio, dense distribution.
The Skew Intersection over Union (SkewIoU) score between large aspect ratio objects is sensitive to the deviations of the object positions.
This causes the negative impact of the inconsistency between metric (dominated by SkewIoU) and regression loss (e.g. l n -norms), which is common in horizontal detection, and is further amplified in rotation detection.
The red and orange arrows in Fig.
1 show the inconsistency between SkewIoU and Smooth L1 Loss.
Specifically, when the angle deviation is fixed (red arrow), SkewIoU will decrease sharply as the aspect ratio increases, while the Smooth L1 loss is unchanged (mainly from the angle difference).
Similarly, when
SkewIoU does not change (orange arrow), Smooth L1 loss increases as the angle deviation increases.
Solution for inconsistency between the metric and regression loss has been extensively discussed in horizontal detection by using IoU loss and related variants, such as GIoU loss (Rezatofighi et al., 2019) and DIoU loss (Zheng et al., 2020b).
However, the applications of these solutions to rotation detection are blocked because the analytical solution of the SkewIoU calculation process is not easy to be provided due to the complexity of intersection between two rotated boxes (Zhou et al., 2019).
Especially, there exist some custom operations (intersection of two edges and sorting the vertexes etc.)
whose derivative functions have not been implemented in the existing deep learning frameworks (Abadi et al., 2016;
Paszke et al., 2017).
Based on the above analysis, developing an easy-to-implement approximate SkewIoU loss is meaningful and several works (Chen et al., 2020;
Zheng et al., 2020a; Yang et al., 2021c;d) have been proposed.
This paper aims to find an easy-to-implement and better-performing alternative.
We design a novel and effective alternative to SkewIoU loss based on Kalman filter, named KFIoU loss, which can be easily implemented by the existing operations of the deep learning framework without the need for additional acceleration (e.g. C++/CUDA).
Specifically, we convert the rotated bounding box into a Gaussian distribution, which can avoid the well-known boundary discontinuity and square-like problems (Yang & Yan, 2020;
Qian et al., 2021a;
Ming et al., 2021b;
Yang et al., 2021c) in rotation detection.
Then we use a center point loss to narrow the distance between the center of the two Gaussian distributions, follow by calculating the overlap area under the new position through
Kalman filter.
By calculating the error variance and comparing the final performance of different methods (including L1 loss, KLD loss, GWD loss and KFIoU loss etc.), we find trend-level alignment with the SkewIoU loss is critical for solving the inconsistency between metric and loss, and further improving the performance.
Furthermore, compared to best-tuned Gaussian distance metric based methods, our proposed method achieves more competitive performance without hyperparameter tuning.
The highlights are as follows:
1) For rotation detection, instead of exactly computing the SkewIoU loss which is tedious and unfriendly to differentiable learning , we propose
our new approximate loss – KFIoU loss.
It follows the protocol of Gaussian modeling for objects (Yang et al., 2021c ;d) , yet innovatively uses
Kalman filter to mimic SkewIoU’s computing mechanism within a
looser distance.
Compared with plain SkewIoU loss, our KFIoU loss is easy-to-implement, and works better due to fully differentiable and able to handle the non-overlapping cases.
Compared to Gaussian-based losses (GWD loss, KLD loss) that try to approximate SkewIoU loss by specifying a distance which requiry extra hyperparameters tuning and metric selection that vary across datasets and detectors, our mechanism level simulation to SkewIoU is more interpretable and natural
and free from hyperparameter tuning.
Compared with GWD loss and KLD loss, we show that KFIoU loss achieves the best trend-level alignment with SkewIoU loss within a certain distance, where the trend deviation is measured by our devised error variance.
The effectiveness of such a trend-level alignment strategy is verified by comparing KFIoU loss with ideal SkewIoU loss.
On extensive benchmarks (aerial images, scene texts, face), our approach also outperforms other best-tuned SOTA alternatives.
We further extend the Gaussian modeling and KFIoU loss from 2-D to 3-D rotation detection, with notable improvement compared with baselines.
To our best knowledge, this is the first 3D rotation detector based on Gaussian modeling which also verifies its effectiveness, which is in contrast to (Yang et al., 2021c;d) focusing on 2-D rotation detection.
R ELATED W ORK
Rotated Object Detection.
Rotated object detection is an emerging direction, which attempts to extend classical horizontal detectors (Girshick, 2015; Ren et al., 2015; Lin et al., 2017a;b) to the rotation case by adopting the rotated bounding boxes.
Aerial images and scene text are popular application scenarios of rotation detector.
For aerial images, objects are often arbitrary-oriented and dense-distributed with large aspect ratios.
To this end, ICN (Azimi et al., 2018), ROI-Transformer (Ding et al., 2019), SCRDet (Yang et al., 2019), Mask OBB (Wang et al., 2019), Gliding Vertex (Xu et al., 2020), ReDet (Han et al., 2021b) are two-stage mainstreamed approaches whose pipeline is inherited from Faster RCNN (Ren et al., 2015), while DRN (Pan et al., 2020), DAL (Ming et al., 2021c), R 3 Det
(Yang et al., 2021b), RSDet (Qian et al., 2021a;b) and S
A-Net (Han et al., 2021a) are based on single-stage methods for faster detection speed.
For scene text detection, RRPN (Ma et al.,
Compared with GWD loss (Yang et al., 2021c) and KLD loss
(Yang et al., 2021d), our approach follows the calculation process of SkewIoU without introducing additional hyperparameters.
We believe such a design is more mathematically rigorous and more in line with SkewIoU loss.
employs rotated RPN to generate rotated proposals and further perform rotated bounding box regression.
TextBoxes++ (Liao et al., 2018a) adopts vertex regression on SSD (Liu et al., 2016).
RRD (Liao et al., 2018b) improves TextBoxes++ by decoupling classification and bounding box regression on rotation-invariant and rotation sensitive features, respectively.
The regression loss of the above algorithms are rarely SkewIoU loss due to the complexity of implementing SkewIoU.
Variants of IoU-based Loss.
The inconsistency between metric and regression loss is a common issue for both horizontal detection and rotation detection.
Solution for this inconsistency has been extensively discussed in horizontal detection by using IoU related loss.
For instance, Unitbox (Yu et al., 2016) proposes an IoU loss which regresses the four bounds of a predicted box as a whole unit.
More works (Rezatofighi et al., 2019; Zheng et al., 2020b) extend the idea of Unitbox by introducing GIoU (Rezatofighi et al., 2019) and DIoU (Zheng et al., 2020b) for bounding box regression.
However, their applications to rotation detection are blocked due to the hard-to-implement of the SkewIoU. Recently, some approximate methods for SkewIoU loss have been proposed.
Box/Polygon based:
SCRDet (Yang et al., 2019) propose IoU-Smooth L1, which partly circumvents the need for SkewIoU loss with gradient backpropagation by combining IoU and Smooth L loss.
To tackle the uncertainty of convex caused by rotation, the work (Zheng et al., 2020a) proposes a projection operation to estimate the intersection area for both 2-D/3-D object detection.
PolarMask (Xie et al., 2020) proposes Polar IoU loss that can largely ease the optimization and considerably improve the accuracy.
CFA (Guo et al., 2021) proposes convex hull based CIoU loss for optimization of point based detectors.
Pixel based: PIoU (Chen et al., 2020) calculates the SkewIoU directly by accumulating the contribution of interior overlapping pixels.
Gaussian based:
GWD (Yang et al., 2021c) and KLD
(Yang et al., 2021d) simulate SkewIoU by Gaussian distance measurement.
B ACKGROUND ON G AUSSIAN M ODELING
This section presents the preliminary according to (Yang et al., 2021c), for how to convert an arbitrary-oriented 2-D/3-D bounding box to a Gaussian distribution G ( µ, Σ ) .
[Equation]
where R represents the rotation matrix, and Λ represents the diagonal matrix of eigenvalues.
For 2-D object B 2 d ( x, y, w, h, θ ) ,
[Equation]
[Equation] [Equation]
and for 3-D object B 3 d ( x, y, z, w, h, l, θ ) ,
R =
[Equation]

[Equation]


[Equation]
Λ
[Equation]
  w
[Equation]
l
[Equation]
  (
[Equation]
[Table]
[Figure]
It is worth noting that the recent works GWD loss (Yang et al., 2021c) and KLD loss
(Yang et al., 2021d) also belong to the Gaussian modeling based.
Compared with our work, their difference is that they use the nonlinear transformation of distribution distance to approximate SkewIoU loss.
In this process, additional hyperparameters are introduced.
Since Gaussian modeling has the natural advantages of being immune to boundary discontinuity and square-like problems, in this paper, we will take another perspective to approximate the SkewIoU loss to better train the detector without any extra hyperparameter, which can be more in line with SkewIoU calculation.
Tab. 1 shows the comparison of properties between different losses.
It should be noted that the results presented in our experiments of GWD loss and KLD loss are obtained by best-tuned hyperparameters in DOTA, but not optimal in others.
P ROPOSED M ETHOD
In this section, we present our main approach.
Fig.
2 shows the approximate process of SkewIoU loss in two-dimensional space based on Kalman filtering.
Briefly, we first convert the bounding box to a Gaussian distribution as discussed in Sec. 3, and move the center points of the two Gaussian distributions to make them close.
Then, the distribution function of the overlapping area is obtained by Kalman filtering.
Finally, the obtained distribution function is inverted into a rotated bounding box to calculate the overlapping area and the SkewIoU and loss.
4. S KEW I O U BASED ON K ALMAN F ILTERING
First of all, we can easily calculate the volume of the corresponding rotating box based on its covariance ( V B ( Σ ) ), when we obtain a new Gaussian distribution:
[Equation]
(4) where n denotes the number of dimensions.
To obtain the final SkewIoU, calculating the area of overlap is critical.
For two Gaussian distributions ( G 1 and G 2 ), we use Kalman filter 1 to get the distribution function of the overlapping area:
[Equation]
Note here α is written by:
[Equation]
where µ = µ 1 + K ( µ 2 − µ 1 ) , Σ = Σ 1 − KΣ 1 , and K is the Kalman gain, K = Σ 1 ( Σ 1 + Σ 2 ) − 1 .
We observe that Σ is only related to the covariance ( Σ 1 and Σ 2 ) of the given two Gaussian distributions, which means that no matter how the two Gaussian distributions move, as long as the covariance is fixed, the area calculated by Eq.
4 will not change (distance-independent).
This is obviously not in line with intuition: the overlapping area should be reduced when the two Gaussian distributions are far away.
The main reason is α G kf ( µ, Σ ) is not a standard Gaussian distribution (probability sum is not 1), we cannot directly use Σ to calculate the area of the current overlap by
Eq.
without considering α .
Eq.
6 shows that α is related to the distance between the center points ( µ 1 − µ 2 ) of the two Gaussian distributions.
Based on the above findings, we can first use a center point loss L c to narrow the distance between the center of the two Gaussian distributions.
In this way, α can be approximated as a constant, and the introduction of the L c also allows the entire loss to continue to optimize the detector in non-overlapping cases.
Then, calculate the overlap area under the new position by Eq. 4.
According to Fig. 2, overlap area is calculated as follow:
[Equation]
where B 1 , B 2 and B 3 refer to the three different bounding boxes shown in the right part of Fig.
In the appendix, we prove that the upper bounds of KFIoU in n-dimensional space is 1 2 n 2 +1 − 1 .
For 2-D/3-D detection, the upper bounds are 13 and 1 √ 32 − 1 respectively when n = 2 and n = 3 .
We can easily stretch the range of KFIoU to [0 , 1] by linear transformation according to the upper bound, and then compare it with IoU for consistency.
Fig. 3(a)-3(b) show the curves of five loss forms for two bounding boxes with the same center in different cases.
Note that we have expanded KFIoU by 3 times so that its value range is [0 , 1] like
SkewIoU. Fig. 3(a) depicts the relation between angle difference and loss functions.
Though they all bear monotonicity, obviously the Smooth L1 loss curve is more distinctive.
Fig. 3(b) shows the changes of the five loss under different aspect ratio conditions.
It can be seen that the Smooth L loss of the two bounding boxes are constant (mainly from the angle difference), but other losses will change drastically as the aspect ratio varies.
Regardless of the case in Fig. 3(c), KFIoU loss can maintain the best trend-level alignment with the SkewIoU loss within 5 pixels devariation.
This conclusion still holds at 9 pixels, which is already quite a distance, especially for aerial image.
To further explore the behavior of different approximate SkewIoU losses, we design the metrics of error mean (EMean) and error variance (EVar) as follows:
[Equation]
where EVar measures the trend-level consistency between the designed loss and the SkewIoU loss.
Tab. 1 calculates the EVar of different losses in Fig. 3(c).
In general, EVar L kfiou + L c < EVar L kld <
EVar L gwd < EVar L 1 .
In our analysis, this is probably due to the fundamental inconsistency between the distribution distance as used in GWD/KLD and the definition of similarity in SkewIoU. Moreover, for GWD such inconsistency is more pronouced, because it has no scale invariance under the same IoU, and a case with a larger scale will get a larger loss value, it can greatly magnify its trend inconsistency with SkewIoU loss.
The results in Tab. 1 also verifies our analysis.
In contrast, the calculation process of KFIoU loss is essentially the calculation of the overlap rate, so it does not require hyperparameters and can maintain a high trend-level consistency with SkewIoU loss
Combined with the corresponding performance on three datasets, smaller EVars tend to have better performance in a general level.
When EVar is small enough, which implies sufficient consistency, the performance difference of different methods (e.g. KLD loss and KFIoU loss) is close.
Therefore, we come to the conclusion that the key to maintaining the consistency between metric and regression loss lies in the trend-level consistency between approximate and exact SkewIoU loss rather than value-level consistency.
The reason why the Gaussian-based losses (e.g. KFIoU loss, KLD loss, GWD loss) outperform the plain SkewIoU loss is due to the advanced parameter optimization mechanism, effective measurement for non-overlapping cases, and complete derivation.
However, the introduction of hyperparameters makes KLD loss and GWD loss less stable than KFIoU loss in terms of Evar and performance.
Compared with GWD and KLD, which use the distribution distance to approximate SkewIoU, KFIoU is physically more reasonable (in line with the calculation process of SkewIoU) and simpler, as well as empirically more effective than best-tuned GWD and
KLD.
In addition, KFIoU implementation is much simpler than plain SkewIoU and can be easily implemented by the existing operations of the deep learning framework.
4. T HE P ROPOSED KFI O U L OSS
We take 2-D object detection as the main example for notation brevity, though our experiments further cover the 3-D case.
We use the one-stage detector RetinaNet (Lin et al., 2017b) as the baseline.
Rotated rectangle is represented by five parameters ( x, y, w, h, θ ).
First, we shall clarify that the network has not changed the output of the original regression branch, that is, it is not directly predicting the parameters of the Gaussian distribution.
The whole training process of detector is summarized as follows: i) predict offset ( t ∗ x , t ∗ y , t ∗ w , t ∗ h , t ∗ θ ); ii) decode prediction box; iii) convert prediction box and target ground-truth into Gaussian distribution; iv) calculate L c and L kf of two
Gaussian distributions.
Therefore, the inference time remains unchanged.
The regression equation of ( x, y, w, h ) is as follows:
[Equation]
where x, y, w, h denote the box’s center coordinates, width and height, respectively.
x, x a , x ∗ are for ground-truth box, anchor box, and predicted box (likewise for y, w, h ).
For the regression of θ , we use two forms as the baselines:
i) Direct regression, marked as Reg.
( ∆ θ ) .
The model directly predicts the angle offset t ∗ θ :
[Equation]
ii) Indirect regression, marked as Reg.
∗ ( sin θ , cos θ ) .
The model predicts two vectors ( t ∗ sin θ and t ∗ cos θ ) to match the two targets from the ground truth ( t sin θ and t cos θ ):
[Equation]
To ensure that t ∗ 2sin θ + t ∗ 2cos θ = 1 is satisfied, we will perform the following normalization processing:
[Equation]
The multi-task loss is:
[Equation]
where N and N pos indicates the number of all anchors and that of positive anchors.
b n denotes the n -th predicted bounding box, gt n is the n -th target ground-truth.
G ( · ) is Gaussian transfer function.
t n represents the label of the n -th object, p n is the n -th probability distribution of classes calculated by sigmoid function.
λ 1 , λ 2 control the trade-off and are set to { 0 . 01 , 1 } .
The classification loss
L cls is set as the focal loss (Lin et al., 2017b).
The regression loss is set by L reg =
L c + L kf , where
[Equation]
See more ablation experiments on the functional form of L kf ( Σ 1 , Σ 2 ) in the Appendix.
For center point loss L c , this paper provides two different forms:
[Table]
The loss adopted in Faster RCNN (Lin et al., 2017a) (default): L c ( t, t ∗ ) =
(cid:80) i ∈ ( x,y ) l n ( t i , t ∗ i ) .
The first term of KLD (Yang et al., 2021d) (advanced), which has an advanced center point optimization mechanism: L c ( µ 1 , µ 2 , Σ 1 ) =
ln (cid:0) ( µ 2 − µ 1 ) [Table] [Table]
− µ 1 ) + 1 (cid:1) .
E XPERIMENTS 5. D ATASETS AND I MPLEMENTATION D ETAILS
Aerial image dataset: DOTA (Xia et al., 2018) is one of the largest datasets for oriented object detection in aerial images with three released versions: DOTA-v1.0, DOTA-v1.5 and DOTA-v2.0.
DOTA-v1.0 contains 15 common categories, 2,806 images and 188,282 instances.
DOTA-v1.5 uses the same images as DOTA-v1.0, but extremely small instances (less than 10 pixels) are also annotated.
Moreover, a new category, containing 402,089 instances in total is added in this version.
While DOTA-v2.0 contains 18 common categories, 11,268 images and 1,793,658 instances.
We divide the images into 600 × 600 subimages with an overlap of 150 pixels and scale it to 800 × 800.
HRSC2016 (Liu et al., 2017) contains images from two scenarios with ships on sea and close inshore.
The training, validation and test set include 436, 181 and 444 images.
Scene text dataset: ICDAR2015 (Karatzas et al., 2015) includes 1,000 training images andtesting images.
MSRA-TD500 (Yao et al., 2012) has 300 training images and 200 testing images.
They are popular for oriented scene text detection and spotting.
Face dataset: FDDB (Jain & Learned-Miller, 2010) is a dataset designed for unconstrained face detection, in which faces have a wide variability of face scales, poses, and appearance.
This dataset contains annotations for 5,171 faces in a set of 2,845 images.
We manually use 70% as the training set and the rest as the validation set.
We use AlphaRotate (Yang et al., 2021e) for implementation, where many advanced rotation detectors are integrated.
Experiments are performed on a server with GeForce RTX 3090 Ti and 24G memory.
Experiments are initialized by ResNet50 (He et al., 2016) by default unless otherwise specified.
We perform experiments on two aerial benchmarks, two scene text benchmarks and one face benchmark to verify the generality of our techniques.
Weight decay and momentum are set 0.0001 and 0.9, respectively.
We employ MomentumOptimizer over 4 GPUs with a total of 4 images per mini-batch (1 image per GPU).
All the used datasets are trained by 20 epochs, and learning rate is reduced tenfold at 12 epochs and 16 epochs, respectively.
The initial learning rate is 1e-3.
The number of image iterations per epoch for DOTA-v1.0, DOTA-v1.5, DOTA-v2.0, HRSC2016,
ICDAR2015, MSRA-TD500 and FDDB are 54k, 64k, 80k, 10k, 10k, 5k and 4k respectively, and doubled if data augmentation (e.g. random graying and rotation) or multi-scale training are enabled.
KITTI (Geiger et al., 2012) contains 7,481 training and 7,518 testing samples for 3-D object detection.
The training samples are generally divided into the train split (3,712 samples) and the val split (3,769 samples).
The evaluation is classified into Easy, Moderate or Hard according to the object size, occlusion and truncation.
All results are evaluated by the mean average precision with a rotated
IoU threshold 0.7 for cars and 0.5 for pedestrian and cyclists.
To evaluate the model’s performance on KITTI val split, we train our model on the train set and report the results on the val set.
[Table]
We use PointPillar (Lang et al., 2019) implemented in MMDetection3D (Chen et al., 2019) as the baseline
[Table]
and the training schedule inherited from SECOND (Yan et al., 2018): ADAM optimizer with a cosine-shaped cyclic learning rate scheduler that spans 160 epochs.
The learning rate starts from 1e-4 and reaches 1e-3 at the 60th epoch, and then goes down gradually to 1e-7 finally.
In the development phase, the experiments are conducted with a single model for 3-class joint detection.
A BLATION S TUDY AND F URTHER C OMPARISON
Ablation study on different center point losses.
Tab. 1 compares the two different center point losses proposed in Sec.
4.2 on three versions of DOTA datasets.
Even with the most commonly used L c ( t, t ∗ ) , KFIoU loss achieves competitive performance, significantly better than GWD loss and comparable to KLD loss.
For a fairer comparison, after adopting the same center point loss term as KLD loss L c ( µ 1 , µ 2 , Σ 1 ) , the performance of KFIoU loss is further improved, which is better than KLD loss thanks to a better center point optimization mechanism.
[Table]
Ablation study on various 2-D datasets with different detectors.
Tab. 2 compares Smooth L1 loss and KFIoU loss by indicators with different IoU thresholds.
For HRSC2016 containing a large number of ships with large aspect ratios, KFIoU loss has a 9.90% improvement over Smooth L on AP 75 .
For the scene text datasets
MSRA-TD and
ICDAR2015,
KFIoU achieves 7.07% and 3.44% improvements on Hmean 50:95 , reaching 44.96% and 41.17% respectively.
The same conclusion can be reached on FDDB and DOTA-v1.0 datasets.
Ablation study of KFIoU loss on 3D detection.
We generalize the KFIoU loss from 2-D to 3-D, with results in
Tab. 3.
It involves 3-D detection and
BEV detection on KITTI val split, and significant performance improvements are also achieved.
On the moderate level of 3-D detection, KFIoU loss improves PointPillars by 3.64% .
On the moderate level of BEV detection, KFIoU loss achieves gains of 2.75% , at 70.91% .
Comparison with peer methods.
Methods in Tab. 4 are based on the same baseline RetinaNet, and initialized by ResNet50 (He et al., 2016) without using data augmentation and multi-scale training/testing.
They are trained/tested under the same environment and hyperparameters.
These methods are all published solutions to the boundary discontinuity in rotation detection.
First, we conduct ablation experiments on anchor form (horizontal and rotating anchors), rotated bounding box definition form (OpenCV definition and Long Edge definition), and angle regression form (direct regression and indirect regression) based on RetinaNet.
Rotating anchors provides accurate prior, which makes the model show strong performance in large aspect ratio objects (e.g. SV, LV,
SH).
However, the large number of anchors makes it time-consuming.
Therefore, we use horizontal
[Table]
anchors by default to balance accuracy and speed.
OpenCV definition ( D oc ) (Yang et al., 2019) and
Long Edge definition ( D le ) (Ma et al., 2018) are two popular methods for defining bounding boxes with different angles.
Experiments show that D oc is slightly better than D le on the three versions of DOTA.
Angle direct regression (Reg.) always suffers from the standing boundary discontinuity problem as widely studied recently (Yang & Yan, 2020).
In contrast, angle indirect regression (Reg ∗ .) is a simpler way to avoid above issues and brings performance boost according to Tab. 4.
PIoU calculates the SkewIoU by accumulating the contribution of interior overlapping pixels but the effect is not significant.
IoU-Smooth L1 partly circumvents the need for SkewIoU loss with gradient backpropagation by combining IoU and Smooth L1 loss.
Although IoU-Smooth L1 has achieved an improvement of 1.26%/0.29%/2.15% on DOTA-v1.0/v1.5/v2.0, the gradient is still dominated by
Smooth L1 but still worse than plain SkewIoU loss.
Modulated Loss and RIL implement ordered and disordered quadrilateral detection respectively, and the more accurate representation makes them both have a considerable performance improvement.
In particular, Modulated Loss achieves the third highest performance on DOTA-v1.5/v2.0.
CSL and DCL convert the angle prediction from regression to classification, cleverly eliminating the boundary discontinuity problem caused by the angle periodicity.
GWD loss, KLD loss and KFIoU loss are three different regression losses based on Gaussian distribution.
The results presented in our experiments of GWD loss and KLD loss are obtained by best-tuned hyperparameters.
In contrast, KFIoU loss is free from hyperparameter tuning and has a more stable performance increase due to a more consistent calculation process with
SkewIoU loss as the center point gets closer.
5. C OMPARISON WITH THE S TATE - OF
- THE -A RT
Tab. 5 compares recent detectors on DOTA-v1.0, as categorized by single-, refine-, and two-stage based methods.
Since different methods use different image resolution, network structure, training strategies and various tricks, we cannot make absolutely fair comparisons.
In terms of overall performance, our method has achieved the best performance so far, at around 77.35% / 81.03% / 80.93% .
C ONCLUSION
We have presented a trend-level consistent approximate to the ideal but gradient-training unfriendly
SkewIoU loss for rotation detection, and we call it KFIoU loss as the Kalman filter is adopted to directly mimic the computing mechanism of SkewIoU loss by definition.
This design differs from the distribution distance based losses including GWD loss and KLD loss which in our analysis have fundamental difficulty in achieving trend-level alignment with SkewIoU loss without tuning hyperparameters.
Moreover, KFIoU is easier to implement and works better than plain SkewIoU due to the effective measurement for non-overlapping cases and complete derivation.
Experimental results on both 2D and 3D cases, on various datasets, show the effectiveness of our approach.
A P ROOF OF KFI O U U PPER B OUND
For an n-dimensional Gaussian distribution its volume is:
[Equation]
For Σ kf we have
[Equation]
According to Minkowski’s inequality:
[Equation]
Simultaneous mean inequalities:
[Equation]
[Table]
Thus:
[Equation]
and
[Equation]
Combine the mean inequalities again:
[Equation]
According to Eq.
15, we have
[Equation]
Therefore, the upper bound of KFIoU is
[Equation]
When n = 2 and n = 3 , the upper bounds are 13 and
[Equation] 32 − 1 respectively.
B S UPPLEMENTARY E XPERIMENT
Ablation study of three forms of KFIoU loss on two detectors.
We use two different detectors and three different KFIoU based loss functions to verify its effectiveness, as shown in Tab. 6.
RetinaNetbased detector will have a large number of low-SkewIoU prediction bounding box in the early stage of training, and will produce very large loss after the log function, which weakens the improvement of the model.
Compared with the linear function, the derivative of the exp -based function will pay more attention to the training of difficult samples, so it has a higher performance, at 70.64% .
In contrast, R 3 Det-based detector can generate high-quality prediction box at the beginning of training by adding refinement stages, so it will not suffer the same troubles as RetinaNet.
Due to the same mechanism of focusing on difficult samples, log and exp -based functions are both better than linear functions, and the best performance is achieved on the log -based function, about 72.28% .
We also expand KFIoU by 3 times to make its range truly consistent with the IoU loss, at [0 , 1] .
However, this consistency do not bring any additional gains, so the following experiments are all use the KFIoU before non-expansion.
Ablation study of training strategies and tricks.
We reimplement KFIoU based on the more powerful benchmark, MMRotate (Zhou et al., 2022).
We use a single GeForce RTX 3090 Ti with a total batch size of 2 for training.
For ResNet (He et al., 2016), SGD optimizer is adopted with an initial learning rate of 0.0025.
The momentum and weight decay are 0.9 and 0.0001, respectively.
For Swin Transformer (Liu et al., 2021), AdamW (Kingma & Ba, 2014; Loshchilov & Hutter, 2018) optimizer is adopted with an initial learning rate of 0.0001.
The weight decay is 0.05.
In addition, we adopt learning rate warmup for 500 iterations, and the learning rate is divided by 10 at each decay step.
Tab.
7 performs ablation experiments on four detectors: RetinaNet (Lin et al., 2017b),
S 2 A-Net
(Han et al., 2021a), R 3 Det
(Yang et al., 2021b), and RoI Transformer (Ding et al., 2019). [Table] [Figure]
The experimental results prove that KFIoU can stably enhance the performance of the detector.
In order to further improve the performance of the model on DOTA, we verified many commonly used training strategies and tricks, including backbone, training schedule, data augmentation and multiscale training and testing, as shown in Tab. 7.
C V ISUALIZATION
Fig.
4 ad Fig.
5 show the visual comparison of three different loss functions on the different kinds of datasets.
Compared with Smooth L1 Loss, KFIoU loss is significantly better.
D T REND C ONSISTENCY S IMULATION
Fig. 6(a) and Fig.
6(b) show the impact of center deviation and object scale on the trend consistency of each loss function.
Note that each data in the figure is calculated from the average of 1, random aspect ratio and rotation angle examples.
Two conclusions can be drawn: i) the smaller the center deviation, the better trend consistency of the KFIoU loss; ii) KLD loss and KFIoU loss are insensitive to scale changes.
E L IMITATIONS
Note that the Gaussian modeling has a limitation that it cannot be directly applied to quadrilateral/polygon detection (Ming et al., 2021b; Xu et al., 2020;
Guo et al., 2021) which is also an important task in the applications of aerial images (Yang et al., 2018a; 2019; Ming et al., 2021a), scene text (Zhou et al., 2017; Jiang et al., 2017; Ma et al., 2018; Liao et al., 2018b), etc.
The tech- [Figure] nical difficulty is how to convert the point set into a Gaussian distribution and potential techniques include maximum likelihood estimation.
We leave it for future work.