FRACTAL CALIBRATION FOR LONG-TAILED OBJECT DETECTION

## Abstract

Abstract Real-world datasets follow an imbalanced distribution, which poses significant challenges in rare-category object detection. Recent studies tackle this problem by developing re-weighting and re-sampling methods, that utilise the class frequencies of the dataset. However, these techniques focus solely on the frequency statistics and ignore the distribution of the classes in image space, missing important information.
In contrast to them, we propose Fra ctal CAL ibration (FRACAL): a novel post-calibration method for long-tailed object detection. FRACAL devises a logit adjustment method that utilises the fractal dimension to estimate how uniformly classes are distributed in image space. During inference, it uses the fractal dimension to inversely downweight the probabilities of uniformly spaced class predictions achieving balance in two axes: between frequent and rare categories, and between uniformly spaced and sparsely spaced classes. FRACAL is a post-processing method and it does not require any training, also it can be combined with many off-the-shelf models such as one-stage sigmoid detectors and two-stage instance segmentation models. FRACAL boosts the rare class performance by up to 8.6 % percent 8.6 8.6\% 8.6 % and surpasses all previous methods on LVIS dataset, while showing good generalisation to other datasets such as COCO, V3Det and OpenImages. The code will be released.

## 1 Introduction

In recent years, there have been astonishing developments in the field of object detection
Carion et al. (); Chen et al. (); Lyu et al. (). Most of these works utilise vast, balanced, curated datasets such as ImageNet1k Deng et al. (), or MS-COCO Lin et al. () to learn efficient image representations.
However, in the real world, data are rarely balanced, in fact, they follow a long-tailed distribution Liu et al. ().
When models are trained with long-tailed data, they perform well for the frequent classes of the distribution but they perform inadequately for the rare classes Wang et al. (); Ren et al. (); Li et al. ().
This problem poses significant challenges to the safe deployment of detection and instance segmentation models in real-world safe-critical applications such as autonomous vehicles, medical applications, and industrial applications, scenarios where rare class detection is paramount.

Many approaches address the long-tailed detection problem by employing adaptive re-weighting or data resampling techniques to handle imbalanced distributions Wang et al. (; ); Zang et al. (). However all these methods require training.
In contrast, in long-tailed image classification, alternative methods focus on mitigating class imbalance during inference through a post-calibrated softmax adjustment (PCSA)

Alexandridis et al. (); Ren et al. (); Hong et al. ().
PCSA boasts strong performance, good compatibility with many methods like data augmentation, masked image modeling, contrastive learning, and does not necessitate specialized loss function optimization, making it more user friendly  Xu et al. (); Cui et al. (); Zhu et al. ().

Figure: Figure 1: Previous PCSA used the class prior $p_{s}(y)$ to align the learned source distribution $p_{s}(y,u|x)$ with the balanced target distribution $p_{t}(y|x)$, without considering the space information $u$, highlighted in blue. FRACAL embeds space information $p_{s}(y,u)$ into class calibration, via the fractal dimension and aligns the learned $p_{s}(y,u|x)$ with $p_{t}(y,u|x)$ better than previous works.
Refer to caption: extracted/5929224/figures/comparison_eccv_v2.png

However, current PCSA methods utilise solely the train set’s class frequency $p_{s}(y)$ as shown in Figure 1-left and they overlook the significance of the classes’ dependence on the location distribution $p_{s}(y,u)$. This is a significant limitation of previous PCSA methods because the location information is a critical indicator considering the correlation between classes $y$ and their respective locations $u$.

Motivated by the class-location dependence Kayhan & Gemert (), in this work, we investigate a novel way to incorporate location information into post-calibration for imbalanced object detection to boost the performance of rare classes by fully exploiting dataset statistics.
We empirically show that naively injecting location statistics results in inferior performance because the location information is sparse for the rare classes. To overcome this, we propose FRACAL (FRActal CALibration), a novel post-calibration method based on the fractal dimension, as shown in Figure 1-right.
Our method aggregates the location distribution of all objects in the training set, using the box-counting method Schroeder (). This resolves the sparsity problem and significantly enhances the performance of both frequent and rare classes as shown in our experiments.

Our method comes with several advantages.
First, it performs an effective class calibration, suitable for the object detection task, using the dataset’s class frequencies.
Secondly, it captures the class-location dependency Kayhan & Gemert (), using the fractal dimension, and it fuses this information into class calibration. This results in a better and unique space-aware logit-adjustment technique that complements the frequency-dependent class calibration method and achieves higher overall performance compared to previous PCSA techniques.

FRACAL can be easily combined with both one-stage and two stage detectors, Softmax and Sigmoid-based models, various instance segmentation architectures, various backbones, sampling strategies, and largely increase the performance during the inference step.
FRACAL significantly advances the performance on the challenging LVISv1 benchmark Gupta et al. () with no training, or additional inference cost by $8.6\%$ rare mask average precision ($AP^{m}_{r}$).

Our contributions are as follows:

- •
For the first time, we show the importance of the class-location dependence in post-calibration for long-tailed object detection.
- •
We capture the location-class dependence via a space-aware long-tailed object detection calibration method based on the fractal dimension.
- •
Our method performs remarkably on various detectors and backbones, on both heavily imbalanced datasets such as LVIS and less imbalanced datasets such as COCO, V3DET and OpenImages, outperforming the state-of-the-art by up to $8.6\%$.

## 2 Related Work

General Object Detection.
General object detection Redmon & Farhadi (); Ren et al. (); Lin et al. (); Liu et al. (); Carion et al. (); Zhu et al. (); Sun et al. (); Chen et al. (); Li et al. () and instance segmentation He et al. (); Huang et al. (); Cai & Vasconcelos (); Chen et al. (); Wang et al. (); Bolya et al. (); Li et al. () have witnessed tremendous advancements.

Recently, transformer-based detectors were proposed which use self-attention to directly learn object proposals Carion et al. (); Zhu et al. (), or diffusion-based methods which use a de-noising process to learn bounding boxes Chen et al. () and segmentation masks Gu et al. (). However, all of these methods struggle to learn the rare classes when trained with long-tailed data Gupta et al. (); Oksuz et al. () due to the insufficient rare samples. To this end, FRACAL enhances the rare class performance using a space-aware logit adjustment that can be easily applied during inference.

Long-tailed image classification.
In the past years, the long-tailed image recognition problem has received great attention, as demonstrated by many recent surveys Oksuz et al. (); Zhang et al. (); Yang et al. () and newly created benchmarks Yang et al. (); Tang et al. (); Gu et al. ().
In long-tailed classification, the works could be split into two groups, representation learning and classifier learning. Representation learning techniques aim to efficiently learn rare class features using oversampling Park et al. (); Hong et al. (); Zang et al. (), contrastive learning Li et al. (); Zhu et al. (); Cui et al. (), using ensemble or fusion models Wang et al. (); Li et al. (; ); Cui et al. (); Aimar et al. (), knowledge distillation Li et al. (); He et al. (); Li et al. (), knowledge transfer Liu et al. (); Parisot et al. (); Zhu & Yang (), sharpness aware minimisation Zhou et al. (; ); Ma et al. () and neural collapse Li et al. (); Zhong et al. (); Liu et al. (). Classifier learning techniques aim to adjust the classifier in favour of the rare classes via decoupled training Kang et al. (); Zhang et al. (); Hsu et al. (), margin adjustment Menon et al. (); Ren et al. (); Hong et al. (); Cao et al. (); Hyun Cho & Krähenbühl (); Zhao et al. (); Alexandridis et al. (); Ye et al. () and cost-sensitive learning Cui et al. (); Khan et al. (); Wang et al. (). Among these works, the Post-Calibrated Softmax Adjustment (PCSA) method Menon et al. (); Hong et al. (); Ma et al. () distinguishes itself through both its strong performance and the absence of any training requirements.
However, most of the classifier and representation learning techniques are hard to adopt in long-tailed object detection. This difficulty arises from the larger imbalance inherent in this task, amplified by the presence of the background class Mullapudi et al. (); Yang et al. (). Moreover, the optimisation of models for this task becomes more complex due to multiple sources of imbalance such as batch imbalance, class imbalance and task imbalance as outlined in this survey Oksuz et al. (). For this reason, we develop FRACAL, which is a post-calibration method tailored to the long-tailed object detection task. Different from post-calibration classification methods Menon et al. (); Hong et al. (), FRACAL enhances the detection performance by leveraging class-dependent space information derived from the fractal dimension. Through space-aware logit-adjustment, FRACAL mitigates biases in both the detection’s location and classification axes.

**Table 1: Post-calibration techniques in long-tailed tasks. $\tau$ and $\gamma$ are hyper-parameters, $bg$ is the background class, $\mu_{y}$ and $\varsigma_{y}$ are estimated class mean and standard deviation respectively. Compared to past works, FRACAL considers both frequency and space statistics as shown in Section 3.**
| Method | Dependency | Adjustment |
| --- | --- | --- |
| Log. Adj. Menon et al. () | Frequency | $z_{y}^{\prime}=z_{y}-\tau\log(p_{s}(y))$ |
| IIF Alexandridis et al. () | Frequency | $z_{y}^{\prime}=-z_{y}\cdot\log(p_{s}(y))$ |
| PC-Softmax Hong et al. () | Frequency | $z_{y}^{\prime}=z_{y}-\log(p_{s}(y))+\log(p_{t}(y))$ |
| Norcal Pan et al. () | Frequency | $p_{y}^{\prime}=\frac{p_{y}/n_{y}^{\gamma}}{p_{bg}+\sum p_{y}/n_{y}^{\gamma}},y<br>\notin bg$ |
| LogN Zhao et al. () | Frequency | $z_{y}^{\prime}=\frac{z_{y}-(\mu_{y}-\min_{y}(\mu_{y}))}{\varsigma_{y}},y\notin<br>bg$ |
| FRACAL (ours) | Space & Frequency | $z_{y}^{\prime}=\text{S}(\text{C}(z_{y}))/{\sum_{j=1}^{C+1}\text{S}(\text{C}(z_<br>{y}))}$ |

Long-tailed object detection.
The most prevalent technique is adaptive rare class re-weighting, which could be applied using either the statistics of the mini-batch  Hsieh et al. (); Tan et al. (); Wang et al. () or the statistics of the
gradient Tan et al. (); Li et al. (). Other works use adaptive classification margins based on the classifier’s weight norms Wang et al. (); Li (), classification score Feng et al. (); He et al. (); Wang et al. (), activation functions Alexandridis et al. (; ), group hierarchies Li et al. (); Wu et al. () and ranking loss Zhang et al. (). Many works use data resampling techniques Zang et al. (); Gupta et al. (); Kang et al. (); Feng et al. (); Wu et al. () or external rare class augmentation Zhang et al. (; ).
All these works optimise the model on the long-tailed distribution and require the construction of a complicated and cumbersome training pipeline. In contrast, our method operates during the model’s inference stage thus it is easier to use and less evasive to the user’s codebase.

Norcal Pan et al. () was the first method to apply a post-calibration technique in imbalanced object detection, achieving promising results without training the detector. They proposed to calibrate only the foreground logits using the train-set’s label statistics and applied a re-normalisation step. LogN Zhao et al. () proposed to use the model’s own predictions to estimate the class statistics and applied standardisation in the classification layer.

However LogN, requires forward-passing the whole training set through the model to estimate the weights, thus it is slower than FRACAL, which is not model-dependent.
Also, both methods do not utilise the spatial statistics of the classes which are valuable indicators since the classes and their location are correlated Kayhan & Gemert ().
To this end, FRACAL balances the detectors using both class and space information, largely surpassing the performance of the previous methods. FRACAL can be easily combined with two-stage softmax-based models like MaskRCNN He et al. (), or one-stage sigmoid detectors such as GFLv2 Li et al. () achieving great results without training or additional inference cost.

Relation to previous works.
In Table 1, we contrast our work to previous post-calibration methods used in classification and object detection. As the Table suggests, all prior methods are frequency-dependent and none of them considers the space statistics.

## 3 Methodology

In Subsection 3.1, we pose the problem of calibration for classification; in Subsection 3.2, we extend it to the problem of object detection and we analyse the location-class dependence. We then, in Subsection 3.3, capture class-dependent space information via the fractal dimension and in Subsection 3.4, we combine it with the class-calibration method and extend it for binary object detectors. We show our approach in Fig. 2.

Figure: Figure 2: During imbalanced object detection, the model makes more frequent class predictions like hat and less rare class predictions like tiara both of which have strong upper location bias. FRACAL utilises fractal dimension and debiases the logits both in the frequency and space axes, making fewer hat predictions and more tiara predictions that are evenly spread, achieving space and frequency balance and increasing performance.
Refer to caption: extracted/5929224/figures/fracal_pipeline.jpg

### 3.1 Background: Classification Calibration

Let $f_{y}(x;\theta)=z$ be a classifier parameterised by $\theta$, $x$ the input image, $y$ the class, $z$ the logit, $\bar{y}$ is the model’s prediction and $p_{s}(y)$ and $p_{t}(y)$ the class priors on the train and test distributions respectively. The post-calibration equation is:

$$ $\begin{split}\bar{y}=&\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y))-\log(p_{s}(y ))).\end{split}$ (1) $$

This has been numerously analysed in previous literature Menon et al. (); Alexandridis et al. (); Hong et al. (); Ren et al. (); Lipton et al. () and we derive it in Appendix.
In short, this shows that to get better performance, one can align the model’s predictions with the test distribution, by subtracting $\log(p_{s}(y))$ and adding $\log(p_{t}(y))$ in the logit space.
We now extend it to object detection.

### 3.2 Classification Calibration for Object Detection

In classification, $p(y)$ can be easily defined using the dataset’s statistics, by using instance frequency $n_{y}$,
i.e. $p(y)=\frac{n_{y}}{\sum_{j}^{C}n_{j}}$.
In object detection, this is not the case because $p(y)$ is affected by the location and the object class.
Accordingly, we define the class priors as:

$$ $p(y,o,u)=p(y|o,u)\cdot p(o,u)=p(y,u)\cdot p(o,u),$ (2) $$

where $o$ denotes the generic object occurrence and $u$ is the location inside the image.
By substituting Eq. 2 inside Eq. 1, we get $\bar{y}$ as:

$$ $\begin{split}\bar{y}=\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y,u)\cdot p_{t}(o ,u))-\log(p_{s}(y,u)\cdot p_{s}(o,u))).\\ \end{split}$ (3) $$

The term $p(o,u)$ in Eq  3 cannot be calculated apriori as it depends on the model’s training (e.g., the IoU sampling algorithm, how the object class is encoded etc(^1^11Typically object detectors use an extra background logit bg to implicitely learn $p(o,u)$.)).
Despite this, $p_{s}(o,u)\approx p_{t}(o,u)$, as we show in the Appendix, which means that the object distributions of the train and the test set remain the same and only the foreground class distribution changes.
As a result:

$$ $\bar{y}=\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y,u))-\log(p_{s}(y,u)))\\$ (4) $$

Next, we show how the location parameter $u$ affects Eq. 4.

#### 3.2.1 Location-class independence.

First, we consider the scenario where the location $u$ does not give any information. In this scenario, $u$ and $y$ are independent variables, thus $p(y,u)=p(y)\cdot p(u)$ and we rewrite Eq. 4 as:

$$ $\displaystyle\bar{y}$ $\displaystyle=\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y)\cdot p_{t}(u))-\log(p _{s}(y)\cdot p_{s}(u)))$ (5) $\displaystyle=\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y))-\log(p_{s}(y))),$ $$

where $p(u)$ is the probability of a random location in the image space and it has been simplified because it is the same in both source and target distributions, i.e., $p_{s}(u)=p_{t}(u)$.
In theory $p_{t}(y)$ is unknown, thus Eq.5 cannot be applied. Despite that, we found that setting $p_{t}(y)=\frac{1}{C}$ works well, because it forces the model to do balanced detections on the test
set. In practice, this maximises average precision because this metric independently evaluates all classes and it rewards balanced detectors Everingham et al. (). Accordingly, the Classification (C) calibration of the logit $z_{y}$ is:

$$ $\text{C}(z_{y})=\begin{cases}z_{y}-\log_{\beta}(\frac{n_{y}}{\sum_{i}^{C}n_{i} })+\log_{\beta}(\frac{1}{C}),\;\;y\in\{1,...,C\}\\ z_{y},\;\;y=\text{bg},\end{cases}$ (6) $$

where $\beta$ is the base of the logarithm that we optimise through hyperparameter search. The background logit remains unaffected because of the assumption that the object distribution is the same in train and test set $p_{s}(o,u)\approx p_{t}(o,u)$, (this assumption is also found in previous works Pan et al. (); Zhao et al. ()).

Figure: Figure 3: Different grid sizes affect the object distribution estimation. When the grid is coarse, e.g., $1\times 1$ or $2\times 2$, there is no or little location information. When it is finer, e.g., $128\times 128$, the probability is sparse, giving noisy estimates for the rare classes.
Refer to caption: extracted/5929224/figures/location_sparsity.jpg

To this end, Eq. 6 can get good performance as shown in our ablation study but it is limited because the assumption that $p(y,u)=p(y)\cdot p(u)$ is not correct.
In the real world, the object detection distribution has a strong center bias, as shown in Fig.3 and discussed in Oksuz et al. (). Furthermore, the location is correlated with the class Kayhan & Gemert (), therefore, $p(y,u)\neq p(y)\cdot p(u)$.
As we show, the location provides valuable information for the long-tailed detection task and we enhance Eq. 6 by fusing location information.

#### 3.2.2 Location-class dependence.

One way to compute $p(y,u)$ is by counting the class occurrences $n_{y}(\mathbf{u})$ along locations that fall inside the cell $\mathbf{u}=[i,j]$ as shown in Fig. 3-left. To do so, we discretise the space of various image resolutions into a normalised square grid $U_{G\times G}$ of fixed size $G\in\mathbf{N}$ and count class occurrences inside every grid cell. Accordingly, the grid dependent calibration is defined as:

$$ $\text{C}_{G}(z_{y,\mathbf{u}})=\begin{cases}z_{y,\mathbf{u}}-\log_{\beta}(p_{s }(y,\mathbf{u}))+\log_{\beta}(p_{t}(y,\mathbf{u}))\\ z_{y,\mathbf{u}},\;\;if\;\;y=\text{bg},\\ \end{cases}$ (7) $$

where $z_{y,\mathbf{u}}$ is the predicted proposal whose center falls inside the discrete cell $\mathbf{u}=[i,j]$ and $p_{t}(y,\mathbf{u})$ is uniform, i.e., $p_{t}(y,\mathbf{u})=\frac{1}{C}\cdot\frac{1}{G^{2}}$.

However, the choice of the grid size $G$ largely affects the estimation of $p(y,u)$, as shown in Fig. 3-right. For example, if we use smaller $G$, the generic object distribution becomes denser and little location information is encoded. If we use larger $G$, the distribution becomes sparse. This is problematic for the rare classes because they are already sparse and their location information is noisy. In Table 4-e, we show that this method shows limited performance.

### 3.3 Calibration using fractals

To solve the sparsity problem introduced by the grid-size, we use fractal dimension $\Phi$ Panigrahy et al. (), which is a metric independent of the grid size $G$.
To calculate $\Phi$, we use the box-counting method Schroeder ():

$$ $\Phi(y)=\lim_{G\rightarrow\infty}\frac{\log\sum_{j=0}^{G-1}\sum_{i=0}^{G-1} \mathbbm{1}(n_{y}(\mathbf{u}))}{\log(G)},$ (8) $$

where $\mathbbm{1}$ is the indicator function. For objects in 2D images, as in our case, $\Phi(y)\in[0,2]$, where 0 is only one object, 1 shows that the objects lie across a line and 2 shows that they are located uniformly across the image space.
For brevity, we rewrite $\nu_{y}=\sum_{j=0}^{G-1}\sum_{i=0}^{G-1}\mathbbm{1}(n_{y}(\mathbf{u}))$ and we give an example in Fig. 4-a.
In practice, Eq. 8 cannot be computed because by increasing $G$, the computation becomes intractable. Instead, we approximate $\Phi$, by evaluating nominator-denominator pairs of Eq. 8 for various values of $G$ up to a threshold $t$ and then fit a line to those points. The slope of this line approximates $\Phi(y)$, because it considers all computed $G-\nu_{y}$ pairs.

Figure: Figure 4: a) An example of the box counting method for the class cow. It iteratively counts the boxes containing its center $\nu$, as $G$ grows. b-c) The blue points are all $G-\nu$ pairs, out of them only the orange points are used to calculate the slope $\Phi$ based on the quadratic rule $G=\lfloor\sqrt{n_{y}}\rfloor$. d-e) Scatter-plot of $\Phi$ against instance frequency, there is a weak correlation i.e. $0.35$ for LVISv1 and $0.375$ for COCO using Pearson’s correlation.
Refer to caption: extracted/5929224/figures/box_counting_fractal_lvis_combined.jpg

Dealing with rare classes.
To select the threshold $t$, we use the quadratic rule $G\leq t=\lfloor\sqrt{n_{y}}\rfloor$. The motivation for this rule is simple, for example, if an object is rare, e.g., it appears 4 times in the whole training set, then it can, at most, fill a grid of size $2\times 2$. For objects with fewer occurrences we cannot compute $\Phi$ and thus we assign $\Phi=1$. Using this rule, we define the maximum number of pairs that are required for fitting the “fractality” line highlighted in orange in Fig. 4-b and Fig. 4-c. For example, the rare object birdbath appears 12 times in the training set, thus we use the first three orange points in Fig. 4-c that correspond to $G=\{1,2,3\}$, to fit the “fractality” line, resulting in a large $\Phi=1.67$. This rule ensures that the fractal dimension computation does not underestimate the rare classes and it gives robust measurements that increase rare class performance as shown in our experiments.
For the cow object that has larger frequency we use more $G-\nu$ orange pairs to fit the line as shown in Fig. 4-b, resulting in $\Phi=1.80$.

Relationship to frequency.
As shown in Fig. 4-d, the fractal dimension weakly correlates with frequency for the LVISv1 dataset, i.e., $0.35$ using Pearson correlation. However, there are many rare classes with large $\Phi\approx 2$, showing that our threshold selection technique is robust for small sample sets. Also, the correlation for the COCO dataset in Fig. 4-e is similar to LVIS because these datasets have the same images. This shows that the relationship of the estimated fractal dimension and the frequency is dependent on the image data itself and not the class imbalance and it highlights that our method is robust for different label distributions, it is not a purely frequency-based method, and it captures the class space statistics effectively.

Usage. After calculating $\Phi$ for all classes in the training set, we perform Space-dependent class calibration (S) during inference:

$$ $\text{S}(z_{y})=\begin{cases}\frac{\sigma(z_{y})}{\Phi(y)^{\lambda}},\;\;y\in \{1,...,C\}\\ \sigma(z_{y}),\;\;y=\text{bg},\end{cases}$ (9) $$

where $\sigma(z_{y})\in(0,1)$ is the model’s prediction for class $y$, with $\sigma()$ the Softmax activation, and $\lambda\geq 0$ is a hyperparameter. Eq. 9 downweighs the classes that appear most uniformly and it upweighs the classes that appear less uniformly. In practice, this scheme enforces a centre bias for frequent classes and no bias for rare classes, as shown in Fig. 2-bottom-right. Intuitively, removing the bias from the rare classes is better than rectifying it because it produces balanced detectors and aligns better with the target distribution as shown in our ablation and our qualitative results.

### 3.4 Localised Calibration

By putting Eq. 6 and Eq. 9 together, we get the final FRActal CALibration (FRACAL) as:

$$ $\text{FRACAL}(z_{y})=\frac{\text{S}(\text{C}(z_{y}))}{\sum_{j=1}^{C+1}\text{S} (\text{C}(z_{j}))}.$ (10) $$

Our proposed method tackles the classification imbalance using additional space statistics. On the classification axis, we use the class priors $p_{s}(y)$ and perform logit adjustments.
On the space axis, we use the fractal dimension $\Phi(y)$ to perform a space-aware calibration that accounts for the object’s location distribution $p_{s}(y,u)$.
In Eq. 10, we renormalise both foreground and background logits to preserve a probabilistic prediction after the space calibration in Eq. 9.

Extending to binary classifiers.
In long-tailed object detection there are many works that use only binary classifiers Alexandridis et al. (); Tan et al. (; ); Li et al. (); Wang et al. (); Hyun Cho & Krähenbühl (); Hsieh et al. ().
In this case, the logit $z_{i}$ performs two tasks simultaneously: It discriminates among the foreground classes and performs background-to-foreground classification. Thus, to correctly apply foreground calibration, we first need to decouple the foreground and background predictions. To do so, we filter out the background proposals using the model’s predictions as follows:

$$ $\text{FRACAL}_{b}(z_{i})=\eta(\text{C}(z_{i})-\log_{\beta}(\frac{\Phi(y)^{ \lambda}}{\sum_{i}^{C}\Phi(i)^{\lambda}})+\log_{\beta}(\frac{1}{C}))\cdot\eta( z_{i}),$ (11) $$

where $\eta(z_{i})$ is the sigmoid activation function that acts as a filter for low-scoring proposals. Compared to Eq. 10, Eq. 11 performs class calibration and space calibration in logit space, lowering the false-positive detection rate.

## 4 Results

**Table 2: Comparison against SOTA on LVISv1 dataset. All competing methods use MaskRCNN and our method reaches the best results in all metrics. $\dagger$ denotes our re-implementation with RFS.**
| Method | Arch. | $AP^{m}$ | $AP^{m}_{r}$ | $AP^{m}_{c}$ | $AP^{m}_{f}$ | $AP^{b}$ |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| NorCal Pan et al. () | R50 | 25.2 | 19.3 | 24.2 | 29.0 | 26.1 |  |
| LogN Zhao et al. () | 27.5 | 21.8 | 27.1 | 30.4 | 28.1 |  |  |
| GOL Alexandridis et al. () | 27.7 | 21.4 | 27.7 | 30.4 | 27.5 |  |  |
| ECM Hyun Cho & Krähenbühl () | 27.4 | 19.7 | 27.0 | 31.1 | 27.9 |  |  |
| CRAT w/ LOCE Wang et al. () | 27.5 | 21.2 | 26.8 | 31.0 | 28.2 |  |  |
| \hdashline<br>FRACAL (ours) |  | 28.6 | 23.0 | 28.0 | 31.5 | 28.4 |  |
| NorCal Pan et al. () | R101 | 27.3 | 20.8 | 26.5 | 31.0 | 28.1 |  |
| LogN Zhao et al. () | 29.0 | 22.9 | 28.8 | 31.8 | 29.8 |  |  |
| GOL Alexandridis et al. () | 29.0 | 22.8 | 29.0 | 31.7 | 29.2 |  |  |
| ECM Hyun Cho & Krähenbühl () | 28.7 | 21.9 | 27.9 | 32.3 | 29.4 |  |  |
| ROG Zhang et al. () | 28.8 | 21.1 | 29.1 | 31.8 | 28.8 |  |  |
| CRAT w/ LOCE Wang et al. () | 28.8 | 22.0 | 28.6 | 32.0 | 29.7 |  |  |
| \hdashline<br>FRACAL (ours) |  | 29.8 | 24.5 | 29.3 | 32.7 | 29.8 |  |

### 4.1 Experimental Setup

We use the Large Vocabulary Instance Segmentation (LVISv1) dataset Gupta et al. () which consists of $100k$ images in the train set and $20k$ images in the validation set.
This dataset has $1,203$ classes grouped according to their image frequency into frequent (those that contain $>100$ images), common (those that contain $10\sim 100$ images) and rare classes (those that contain $<10$ images) in the training set.
For evaluation, we use average mask precision $AP_{m}$, average box precision $AP_{b}$ and $AP^{m}_{f}$, $AP^{m}_{c}$ and $AP^{m}_{r}$ that correspond to $AP^{m}$ for frequent, common and rare classes.
Unless mentioned, we use Mask R-CNN He et al. () with FPN Lin et al. (), ResNet50 He et al. (), repeat factor sampler (RFS) Gupta et al. (), Normalised Mask and cosine classifier as used in Wang et al. (), CARAFE Wang et al. () and we train the baseline model using the 2x schedule He et al. (), SGD, learning rate $0.02$ and weight decay $1e-4$. For Swin-T, we train the baseline model with the 1x schedule, RFS, AdamW Kingma & Ba () and $0.001$ learning rate.
During inference, we set the IoU threshold at $0.3$ and the mask threshold at $0.4$.FRACAL is applied before the non-maximum suppression step. We use the mmdetection framework Chen et al. () and train the models using V100 GPUs.

### 4.2 Main Results

Comparison to SOTA. In Table 4, we compare FRACAL to the state-of-the-art using ResNet50 and ResNet101.
Using ResNet50, FRACAL significantly surpasses GOL Alexandridis et al. () by $0.9\text{pp}$ $AP^{m}$ and by $1.6$pp $AP^{m}_{r}$.
On ResNet101 FRACAL achieves $29.8\%$ $AP^{m}$ and $24.5\%$ $AP^{m}_{r}$, outbesting GOL by $0.8\text{pp}$ and $1.7\text{pp}$ respectively.

FRACAL achieves excellent results not only for rare categories but also for frequent ones, due to the use of fractal dimension, which allows the model to upscale the predictions of frequent but non-uniformly located categories. It achieves $31.5\%$ $AP^{m}_{f}$ with ResNet50 and $32.7\%$ $AP^{m}_{f}$ with ResNet101 and surpasses the next best method, ECM Hyun Cho & Krähenbühl () by $0.4\text{pp}$.

Compared to the previous post-calibration method, Norcal Pan et al. (), FRACAL increases performance by $3.4\text{pp}$ $AP^{m}$, $3.7\text{pp}$ $AP^{m}_{r}$, $3.8\text{pp}$ $AP^{m}_{c}$, $2.5\text{pp}$ $AP^{m}_{f}$ and $2.3\text{pp}$ $AP^{b}$ using ResNet50. This is because FRACAL boosts both rare and frequent categories via classification and space calibration, respectively, while Norcal only boosts the rare categories and lacks space information.

We also compare our method in Transformer backbones.
Using Swin-T, FRACAL considerably outperforms Seesaw Wang et al. () by $1.2\text{pp}$ $AP^{m}$, $1.7\text{pp}$ $AP^{m}_{r}$, $1.2\text{pp}$ $AP^{m}_{c}$, $1.0\text{pp}$ $AP^{m}_{f}$ and $0.8\text{pp}$ $AP^{b}$ as shown in Table 3-a. Using Swin-S, FRACAL largely surpasses Seesaw in all metrics and particularly in $AP^{m}_{r}$ by $2.2\text{pp}$ which is a significant $8.6\%$ relative improvement for the rare classes.

**Table 3: In (a), we show that FRACAL can be used with Swin transformers Liu et al. () and surpass the SOTA. In (b), we show that FRACAL can be used with both Sigmoid and Softmax based detectors and improve their precision.**
| Method<br>$AP^{m}$<br>$AP^{m}_{r}$<br>$AP^{m}_{c}$<br>$AP^{m}_{f}$<br>$AP^{b}$<br>RFS-(T)<br>27.7<br>17.9<br>27.9<br>31.8<br>27.1<br>Seesaw-(T)<br>29.5<br>24.0<br>29.3<br>32.2<br>29.5<br>GOL-(T)<br>28.5<br>21.1<br>29.5<br>30.6<br>28.3<br>\hdashlineFRACAL-(T)<br>30.7<br>25.7<br>30.5<br>33.2<br>30.3<br>RFS-(S)<br>30.9<br>21.7<br>31.0<br>34.7<br>31.0<br>Seesaw-(S)<br>32.4<br>25.6<br>32.8<br>34.9<br>32.9<br>GOL-(S)<br>31.5<br>24.1<br>32.3<br>33.8<br>32.0<br>\hdashlineFRACAL-(S)<br>33.6<br>27.8<br>33.9<br>35.9<br>33.4 | Method<br>$AP^{b}$<br>$AP^{b}_{r}$<br>$AP^{b}_{c}$<br>$AP^{b}_{f}$<br>ATSS Zhang et al. ()<br>25.3<br>15.8<br>23.4<br>31.6<br>w/ FRACAL (ours)<br>26.7<br>20.8<br>25.9<br>30.9<br>GFLv2 Li et al. ()<br>26.6<br>14.7<br>25.1<br>33.5<br>w/ FRACAL (ours)<br>28.2<br>19.4<br>27.2<br>33.2<br>GFLv2 (DCN) Li et al. ()<br>27.4<br>13.7<br>26.1<br>34.8<br>w/ FRACAL (ours)<br>28.9<br>18.7<br>27.9<br>34.5<br>APA Alexandridis et al. ()<br>26.9<br>14.3<br>26.2<br>33.2<br>w/ FRACAL (ours)<br>29.2<br>22.1<br>28.0<br>33.7<br>C-RCNN Cai & Vasconcelos ()<br>28.6<br>16.5<br>27.8<br>34.9<br>w/ FRACAL (ours)<br>31.5<br>24.3<br>31.0<br>35.3 |
| --- | --- |
| (a) Results using Swin (T/S) and MaskRCNN. | (b) Comparisons using various detectors and ResNet50. |

Results on object detectors.
We evaluate FRACAL with common object detectors in Table 3-b using ResNet50. FRACAL boosts the overall and rare category performance of both one-stage detectors such as ATSS Zhang et al. () or GFLv2 Li et al. () and two-stage detectors such as Cascade RCNN Cai & Vasconcelos () and APA-MaskRCNN Alexandridis et al. (). Note that on sigmoid-detectors such as ATSS or GFLv2, FRACAL largely boosts the performance of rare and common categories but it slightly reduces the performance of frequent categories. Since the sigmoid activation performs independent classification, the binary version of FRACAL struggles to properly calibrate the predicted unnormalised vector. This limitation was also found in previous works Pan et al. () which also reported that binary logit adjustment produces performance trade-offs between frequent and rare categories.
For softmax-based detectors, such as Cascade RCNN and APA, FRACAL boosts all categories.

### 4.3 Ablation Study and Analysis

The effect of each module. FRACAL consists of simple modules that we ablate in Table 4-a. First, MaskRCNN with CARAFE Wang et al. (), normalised mask predictor Wang et al. (), cosine classifier Wang et al. () and random sampler achieves $22.8\%$ $AP^{m}$ and $8.2\%$ rare category $AP^{m}_{r}$. On top of this, the fractal dimension calibration (S) improves $AP^{m}$ and $AP_{r}^{m}$ by $2.8\text{pp}$ and $5.5\text{pp}$ respectively.

Using only the classification calibration, (C), $AP^{m}$ and $AP_{r}^{m}$ are enhanced by $3.5\text{pp}$ and $8.3\text{pp}$ respectively, because this technique majorly upweights the rare classes. When (S) is added, then it further increases $AP^{m}$ by $1.0\text{pp}$ and $AP_{r}^{m}$ by $2.5\text{pp}$ compared to only (C), reaching $27.3\%$ $AP^{m}$ and $19.0\%$ $AP_{r}^{m}$. This suggests that (S) is useful and the detector can benefit from space information. The same trend is observed with RFS in Table 4-d, however, both calibration methods have lower gains because RFS partly balances the classes via oversampling.

Class calibration parameter search.
We further ablate the choice of the log base $\beta$ in Eq. 6, using the most common cases: $2$ (bit), $e$ (nat), and $10$ (hartley).
As shown in Table 4-b, the base-10 is the best as it achieves $26.3\%$ $AP^{m}$ and $16.5\%$ $AP_{r}^{m}$ with the random sampler and $28.0\%$ $AP^{m}$ and $22.4\%$ $AP_{r}^{m}$ with RFS, thus we use it for all experiments on LVIS.
We also observe that further increasing $\beta$ does not come with a performance improvement.

**Table 4: Ablations using MaskRCNN-ResNet50. C and S denote the class and location calibration.**
| C<br>S<br>$AP^{m}$<br>$AP^{m}_{r}$<br>22.8<br>8.2<br>✓<br>25.6<br>13.7<br>✓<br>26.3<br>16.5<br>✓<br>✓<br>27.3<br>19.0 | $\lambda$<br>$AP^{m}$<br>$AP^{m}_{r}$<br>$AP^{m}_{c}$<br>$AP^{m}_{f}$<br>$AP^{b}$<br>0.0<br>28.0<br>22.4<br>27.3<br>31.2<br>27.4<br>1.0<br>28.5<br>23.0<br>28.0<br>31.6<br>28.3<br>2.0<br>28.6<br>23.0<br>28.0<br>31.5<br>28.4<br>3.0<br>28.5<br>23.2<br>28.0<br>31.5<br>28.4<br>4.0<br>28.5<br>23.4<br>27.9<br>31.3<br>28.4 | $\beta$<br>random<br>RFS<br>$AP^{m}$<br>$AP^{m}_{r}$<br>$AP^{m}$<br>$AP^{m}_{r}$<br>2<br>19.9<br>14.7<br>19.9<br>18.8<br>$e$<br>25.1<br>16.6<br>25.8<br>21.1<br>10<br>26.3<br>16.5<br>28.0<br>22.4 |
| --- | --- | --- |
| (a) Random sampler. | (b) Ablation study of $\beta$, with RFS. | (c) Ablation study of $\lambda$. |
| C<br>S<br>$AP^{m}$<br>$AP^{m}_{r}$<br>25.7<br>15.8<br>✓<br>27.7<br>20.7<br>✓<br>28.0<br>22.4<br>✓<br>✓<br>28.6<br>23.0 | Method<br>$AP^{m}$<br>$AP^{m}_{r}$<br>$AP^{m}_{c}$<br>$AP^{m}_{f}$<br>$AP^{b}$<br>G=1<br>28.0<br>22.4<br>27.3<br>31.2<br>27.4<br>G=2<br>27.1<br>17.5<br>27.2<br>31.1<br>26.6<br>G=4<br>25.0<br>10.5<br>25.4<br>31.1<br>24.9<br>ours<br>28.6<br>23.0<br>28.0<br>31.5<br>28.4 | Method<br>$AP^{m}$<br>$AP^{m}_{r}$<br>$AP^{b}$<br>Invert FRACAL<br>27.4<br>20.5<br>26.9<br>Normal FRACAL<br>28.6<br>23.0<br>28.4 |
| (d) Results using RFS. | (e) Results with Grid-based method. | (f) Invert FRACAL is inferior. |

Fractal dimension coefficient.
We ablate the choice of the $\lambda$ coefficient in the fractal dimension calibration Eq. 9. As shown in Table 4-c,
the optimal performance is achieved with $\lambda=2$ which increases the rare categories by $0.6\text{pp}$, the common categories by $0.7\text{pp}$, the frequent categories by $0.3$pp, the overall mask performance by $0.6\text{pp}$ and the box performance by $1.0\text{pp}$.

Comparison to grid-dependent calibration.
We compare FRACAL against the grid-based method, Eq. 7, in Table 4-c.
When $G=1$ the method does not consider any location information because all predictions fall inside the same grid cell. This achieves the best performance and it is the same result with the $\lambda=0$ of Table 4-c. When the grid size $G$ is enlarged, the performance of the rare classes drops significantly because the estimated prior distribution $p_{s}(y,\mathbf{u})$ becomes sparse (see Fig. 3).
FRACAL does not suffer from this problem, because it re-weights all proposals based on fractal dimension.

Inverting FRACAL. We further examine the opposite weighting logic, which is to upweight the uniform located classes and downweight the non-uniform located classes. This technique further rectifies the location bias instead of removing it from the object detectors. As Table 4-f shows, the Invert FRACAL method is inferior to the normal one, because it produces an imbalanced detector.

Generalisation to other datasets.
We test FRACAL on MS-COCO Lin et al. (), V3DET  Wang et al. () and OpenImages Kuznetsova et al. () to understand its generalisation ability. The first two datasets are fairly balanced therefore, we do not expect our long-tailed designed detector to massively outperform the others. In Table 5 a-b, FRACAL increases the performance of all models, by an average of $0.5\text{pp}$ $AP^{b}$ and $AP^{m}$ on COCO and by $0.4\text{pp}$ $AP^{b}$ on V3DET. In Table 5-c, we show that FRACAL outperforms ECM using CascadeRCNN by $1.7\text{pp}$ and it further increases the performance of CAS by $2.0\text{pp}$ and $1.2\text{pp}$ using FasterRCNN and CascadeRCNN respectively.

Qualitative Analysis.
In Fig. 5, we show: (a) the ground truth distribution, (b) the baseline and (c) FRACAL predicted distributions concerning general objects (1), the rare class ferret (2) and the frequent class zebra (3).
FRACAL achieves better precision than the baseline because it predicts fewer generic objects in (1-c) than the baseline (1-b); it predicts more rare classes that are more uniformly located in (2-c) than the baseline in (2-b); and it predicts less frequent classes that have a stronger center-bias as shown in (3-c) than the baseline in (3-b). These results show that FRACAL aligns its predictions better with the ground-truth distribution than the baseline.

**Table 5: Results on other detection datasets.**
| Method<br>$AP^{m}$<br>$AP^{b}$<br>ResNet50 He et al. ()<br>35.4<br>39.4<br>with FRACAL (ours)<br>35.8<br>39.9<br>SE-ResNet50 Hu et al. ()<br>36.9<br>40.5<br>with FRACAL (ours)<br>37.4<br>41.1<br>CB-ResNet50 Woo et al. ()<br>37.3<br>40.9<br>with FRACAL (ours)<br>37.8<br>41.5<br>Swin-T Liu et al. ()<br>41.6<br>46.0<br>with FRACAL (ours)<br>41.9<br>46.4 |
| --- |
| (a) Results on COCO with MaskRCNN. |
| Method<br>$AP^{b}$<br>$AP^{b}_{50}$<br>$AP^{b}_{75}$<br>APA Alexandridis et al. ()<br>29.9<br>37.6<br>32.9<br>with FRACAL (ours)<br>30.3<br>37.7<br>33.2 |
| (b) Results on V3Det Wang et al. () with<br>FasterRCNN and ResNet50. |
| Method<br>Detector<br>$AP^{b}_{50}$<br>CAS Liu et al. ()<br>FRCNN<br>65.0<br>CAS with FRACAL (ours)<br>67.0<br>CAS Liu et al. ()<br>CRCNN<br>66.3<br>ECM Hyun Cho & Krähenbühl ()<br>65.8<br>CAS with FRACAL (ours)<br>67.5 |
| (c) Results on OpenImages using ResNet50. |

## 5 Conclusion

We propose FRACAL, a novel post-calibration method for long-tailed object detection.
Our method performs a space-aware logit adjustment, that utilises the fractal dimension and incorporates space information during calibration. FRACAL majorly boosts the performance of the detectors and makes more rare class predictions that are evenly spread inside the image. We show that FRACAL can be easily combined with both one-stage Sigmoid detectors and two-stage Softmax segmentation models.
Our method boosts the performance of detectors by up to $8.6\%$ without training or additional inference cost, surpassing the SOTA in the LVIS benchmark and showing good generalisation to COCO, V3Det and OpenImages.

## Appendix A Background: Classification Calibration

We theoretically derive the classification calibration for image classification.
Let $p_{s}(y|x)$ and $p_{t}(y|x)$ be the source and target conditional distributions. Using the Bayes theorem, we write the source and target conditional distributions as:

$$ $p_{s}(y|x)=\frac{p_{s}(x|y)p_{s}(y)}{p_{s}(x)}\;,p_{t}(y|x)=\frac{p_{t}(x|y)p_ {t}(y)}{p_{t}(x)}$ (12) $$

Dividing them, we write the target conditional distribution:

$$ $\begin{split}p_{t}(y|x)=&\frac{1}{\kappa(x)}\frac{p_{t}(y)}{p_{s}(y)}p_{s}(y|x )\frac{p_{t}(x|y)}{p_{s}(x|y)}\end{split}$ (13) $$

where $\kappa(x)=\frac{p_{t}(x)}{p_{s}(x)}$.
During training, we approximate $p_{s}(y|x)$ by model $f_{y}(x;\theta)=z$ and a scorer function $s(x)=e^{x}$ for multiple category classification. Thus, the learned source conditional distribution is $p_{s}(y|x)\propto e^{f_{y}(x;\theta)}$.
Substituting it inside Eq. 13, we rewrite the target condition distribution as:

$$ $\begin{split}p_{t}(y|x)\propto&\frac{1}{\kappa(x)}\frac{p_{t}(y)}{p_{s}(y)}e^{ f_{y}(x;\theta)}\frac{p_{t}(x|y)}{p_{s}(x|y)}\\ =&d(x,y)\cdot e^{f_{y}(x;\theta)+\log(p_{t}(y))-\log(p_{s}(y))-\log(\kappa(x)) }\end{split}$ (14) $$

where we assume that $d(x,y)=\frac{p_{t}(x|y)}{p_{s}(x|y)}=1$. This is a reasonable assumption, in cases where both train and test generating functions come from the same dataset, as it is in our benchmarks. In inference, we calculate the prediction $\bar{y}$ by taking the maximum value of Eq. 14:

$$ $\begin{split}\bar{y}=&\arg\max_{y}e^{(f_{y}(x;\theta)+\log(p_{t}(y))-\log(p_{s }(y))-\log(\kappa(x)))}\\ =&\arg\max_{y}(f_{y}(x;\theta)+\log(p_{t}(y))-\log(p_{s}(y)))\end{split}$ (15) $$

where $\kappa(x)$ is simplified because it is a function of $x$ and it is invariant to $\arg\max_{y}$.
Eq. 15 is the post-calibration method Menon et al. (); Hong et al. (). It can be used during inference to achieve balanced performance by injecting prior knowledge inside the model’s predictions, via $p_{t}(y)$ and $p_{s}(y)$, in order to align the source with the target label distribution and compensate for the label shift problem.

## Appendix B Fractal Dimension Variants

We explore various ways for computing the fractal dimension using the box-counting method Schroeder (), the information dimension Rényi () (Info), and a smooth variant (SmoothInfo).
The information variant is defined as:

$$ $\text{Info-}\Phi(y)=\lim_{G\rightarrow\infty}\frac{\log\sum_{j=0}^{G-1}\sum_{i =0}^{G-1}\frac{\mathbbm{1}(n_{y}(\mathbf{u}))}{G}}{\log(G)}$ (16) $$

It is the similar to the box-counting dimension, except for the box count which is normalised by dividing by the grid size $G$. This way, the information dimension is represented by the growth rate of the probability $p=\frac{\mathbbm{1}(n_{y}(\mathbf{u}))}{G}$ as $G$ grows to infinity.

In practise, the quantity $\mathbbm{1}(n_{y}(\mathbf{u}))$ can be frequently zero for many locations $\mathbf{u}$ especially for rare classes that have few samples and are sparsely located. For this reason, we also proposed a smooth information variant defined as:

$$ $\text{Smooth-}\Phi(y)=\lim_{G\rightarrow\infty}\frac{1+\log\sum_{j=0}^{G-1} \sum_{i=0}^{G-1}\frac{1+\mathbbm{1}(n_{y}(\mathbf{u}))}{G}}{\log(G)}$ (17) $$

This Equation is inspired by the smooth Inverse Document Frequency Robertson () used in natural language processing and its purpose is to smooth out zero values in $\mathbbm{1}(n_{y}(\mathbf{u}))$ calculation.

**Table 6: Fractal Dimension Variants using MaskRCNN with ResNet50 and RFS on LVISv1. All of the are robust and we have chosen the Box variant in the main paper.**
| Dimension | $AP^{m}$ | $AP^{m}_{r}$ | $AP^{b}$ |
| --- | --- | --- | --- |
| Info | 28.6 | 23.2 | 28.3 |
| SmoothInfo | 28.6 | 23.4 | 28.3 |
| Box | 28.6 | 23.0 | 28.4 |

All variants are robust and SmoothInfo achieves slightly better $AP^{m}_{r}$ because its calculation is more tolerant to few samples compared to the box-counting method. However, SmoothInfo and Info achieve slightly worse $AP^{b}$, thus we use the box-counting method in the main paper.

Figure: Figure 6: Comparison between the $p_{s}(o,u)$ (left) and $p_{t}(o,u)$ (right) in LVISv1 dataset. The distributions are similar, therefore we can safely assume that $p_{s}(o,u)\approx p_{t}(o,u)$.
Refer to caption: extracted/5929224/figures/lvis_obj_trainval.png

## Appendix C Object Distributions

We show that the object distribution $p_{s}(o,u)$ in the training set is similar to the object distribution $p_{t}(o,u)$ on the test set in the LVIS v1 dataset Gupta et al. (). As shown in Figure 6, the distributions are close therefore we can safely assume that $p_{s}(o,u)\approx p_{t}(o,u)$. This explains the reason why the background logit should remain intact during calibration because there does not exist label shift for the generic object class (also for the background class) between the train and test sets.

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: - Can you report AP_s, AP_m, AP_l, AP_r, AP_c, AP_f on COCO? 
- Can you report results using SOTA object detectors? 
- In all the papers I know, AP_box is larger than AP_mask. In your results, they are very similar to each other, and even AP_box<AP_mask in one case (Table 2). How do you explain this? 
- How do you explain your assumptions in Eq2? 
- Does FRACAL capture the location distribution differences when the number of instances between two classes are the same? (my second point above in the “Substantiation of the main claim”).
soundness: 2
strengths: The paper tackles a relevant and important problem. Post-training calibration of object detectors is of practical importance. Integrating spatial location awareness into logit adjustment is a novel and interesting idea. 

The authors report improved results on many datasets.
summary: This paper proposes a post-training logit adjustment method designed specifically for long-tailed object detection. Its novelty lies in incorporating spatial location distributions directly into logit adjustment. 

A brief background on logit adjustment: it is primarily used when you have an imbalanced / long-tailed training set but you care about class-balanced accuracy for inference, that is, you have a balanced test set. Suppose you have a trained model f, and you want to predict the category of input x. Normally, you do $\arg\max_y f_y(x)$, where $f_y(x)$ represents the logit for class y for input x. Logit adjustment modifies this by computing $\arg\max_y f_y(x) + \log p_{train}(y) - \log p_{test}(y)$. In short, (log) class priors are factored in at the logit level during inference. 

This paper is proposing to integrate object location distribution into logit adjustment. So, it is basically replacing the $\log p$'s above with other distributions that are aware of the spatial distribution of object instances within an image. They achieve this through a multiscale box-counting method where boxes span a coarse-to-fine grid (e.g. from 2x2, 3x3 to NxN). 

The authors report improved performance  on LVISv1, COCO, V3Det and OpenImages.
weaknesses: There are three major weaknesses:  
1. Clarity: The paper is not well-written. Important pieces of information are not clear. 
2. Substantiation of the main claim: I am not sure whether the main claim of the paper, which is incorporating spatial location distributions, is substantiated. 
3. Performance comparisons: Experimental comparisons do not provide a clear indication whether we should use this technique with modern object detectors. 

I explain them in detail below. 

## Clarity: 

- Equation 2, which actually presents the mathematical model for class-location dependence, is not explained well. There are certainly some independence assumptions among category, location and generic objectness here. Such a key expression should be explained in sufficient detail.
- L213: “generic object occurrence” -> what does this mean exactly? 
- The rule to deal with rare classes (lines 321-330) is not clear to me at all. It is not clear how orange and blue dots are identified. 
- Figure 1, at the point where it appears, is not understandable at all. It heavily relies on notation, which is not introduced yet. The right panel of Figure 1 is simply a fancy figure. It doesn’t convey useful/key information to the reader. 
- Figure 2 is also not understandable. If the p(hat,u) on the left reflects ground-truth, how come the p(hat,u) on the right is a good prediction? Same with tiara. 
- Figure 5 is not understandable. Reading the explanation in the caption and the paragraph in lines 522-528 several times, I still do not know what this figure proves.  
- In general, the math notation is lousy. E.g. z_y is called a logit (L251) and z_y,u is called a “predicted proposal” (L296). It would help if the notation is made more rigorous. “Generic object occurrence” is ambiguous. Instead, defining concepts using object proposals (boxes, anchors, etc.) would be more useful. 
- Usage of all \cite commands are wrong. Authors should look up how to use \citep and \citet.
- What is “pp”? Percentage points? Should have been explained in text. 

## Substantiation of the main claim:

- The main claim of the paper is incorporating location information to the prior. But is there a discrepancy between train and test sets regarding location distributions? In L257, authors themselves write that object location distribution is the same in train and test sets. 
- Does the box counting method really reflect the spatial location distribution of instances? I am not sure. It seems like a complicated way of counting instances. For example, it is hinted in Figure 2 that “hat” and “tiara” are objects that occur at the top portion of images. How is this location information taken into account by the box-counting method? A convincing ablation would be as follows: let’s create two classes of objects. For the first one, let all its instances be in the top part of the images, and for the second one, let all its instances be in the bottom part. Would FRACAL perform better than baseline or other detectors? 
- Claims made about performance may not hold true if more modern object detectors are used (see below). 

## Performance comparisons:

- SOTA comparisons are using old backbones (Resnet50, 101), therefore the performance is limited. On LVIS, the performance is around 50 AP (https://paperswithcode.com/sota/object-detection-on-lvis-v1-0-val). Methods from 2022 report 53.4 AP_b, 48.1 AP_m (Li, Mao, Girshick, He; ECCV2022). Since FRACAL is training free, it should be easy to apply it to more recent detectors and report results. This would give us a better picture on how effective the proposed method is. 
- More detailed results on COCO would help, such as AP_small. Also, it should be easy to create AP_rare, AP_freq on COCO.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 2
questions: See Weaknesses*
soundness: 3
strengths: 1. This paper addresses an underexplored aspect in long-tailed object detection by introducing spatial information into post-calibration using fractal dimensions. This is innovative and may inspire new directions in handling data imbalance in object detection.

2. The proposed FRACAL method achieves significant improvements in performance for rare classes without retraining or additional inference costs, making it a practical tool for applications needing efficient solutions.

3. The authors conduct extensive experiments on multiple datasets (LVIS, COCO, V3Det, OpenImages), comparing FRACAL to state-of-the-art methods. The consistent performance gains demonstrate FRACAL's robustness and generalizability across different detection settings.
summary: The paper proposes a novel approach, Fractal Calibration (FRACAL), for long-tailed object detection, addressing the common issue of imbalanced datasets where rare classes are often underrepresented. The authors introduce a post-processing method that adjusts logits using fractal dimensions, accounting for both class frequency and spatial distribution. FRACAL does not require training, can be integrated with various detection models, and shows strong performance improvements on rare classes across several benchmarks, including LVIS, COCO, and OpenImages.
weaknesses: 1. While the fractal dimension is a core component of the proposed method, the paper could benefit from a more detailed analysis on how different fractal dimension values influence performance across categories. This would add insight into the method's adaptability to datasets with varying spatial distributions.

2. The paper briefly discusses the limitations of grid-based approaches but does not thoroughly compare FRACAL against alternative spatial calibration methods. Including this would help contextualize FRACAL's advantages and trade-offs relative to other spatial calibration techniques.

3. The choice of parameters, such as the fractal dimension coefficient (𝜆) and log base (𝛽), might make FRACAL difficult to tune for practitioners who may not have expertise in spatial calibration. More guidance on parameter selection based on dataset characteristics could improve usability.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: NA
soundness: 3
strengths: 1) This paper attempts to introduce the class-location dependency to post-calibration, which enhances the performance of rare categories. 

2) This work fuses the space information by integrating the fractal dimension and optimizes the detection performance.

3) This is a plug-in-plug-out module, so it does not need extra training.
summary: This paper proposed a new post-calibration method, named Fractal calibration (FRACAL), to solve the problem of data imbalance which widely exists in long tail object detection. In particular, this method considered the distribution of categories in image space by using fractal dimension.
weaknesses: 1) I feel confused about the description of Fig. 1. Why class prior ps(y) is used to align ps(y, u|x) with pt(y|x) rather than align ps(y|x) with pt(y|x)? Do you mean that space information has been considered by previous work just for training data?

2) Although the fractal dimension is introduced, the theoretical explanation of how the fractal dimension specifically affects the detection of rare categories can be more detailed. It is possible to further discuss how the fractal dimension improves the performance of category-position dependencies or provide some more intuitive explanations.

3) Although FRACAL is applied at the inference stage, calculating the fractal dimension may affect the inference speed. It is recommended to add relevant complexity analysis to evaluate the impact of fractal dimension calculation on inference efficiency and the performance of this method on resource-constrained devices.

4) More visualization examples of experimental results can be added to demonstrate the performance of FRACAL in rare category detection, such as the detection location distribution or confidence changes of certain categories, to enhance the intuitiveness of the method's effect.

5) Fig. 2 needs to be explained in more detail, especially for the bar chart located in the right part.

6) Why do different datasets and ablation experiments have different evaluation indicators? I suspect that other indicators are not listed because they are not as good as existing methods. If not, please explain the reason.

7) More minor issues should be more attention. I just list part of them: 
(1) Figure 1-left should be Fig. 1-left.
(2) Eq 3 lost dot (Eq. 3).
(3) The sub-tables in Table 4 should appear in the order of the ablation experiments.
(4) In Table 4-e, please clearly show the G values ​​used in the final model.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: Please see Weaknesses.
soundness: 2
strengths: + Calibration is a viable method for reducing the impact of class/data imbalance.
+ The gap identified by the authors (i.e., taking location distribution into account during calibration) is definitely promising.
+ The proposed calibration method taking into account prior distribution of samples across space as well as the fractal dimension is novel.
summary: In this paper, the authors introduce a calibration method for object detectors. Unlike prior work focusing on this problem, the authors propose considering the location distribution of the samples as well while adjusting the probabilities of classes. To this end, the authors develop a fractal-dimension-based measure of the spatial dispersion of samples for a class and adjust the prediction probabilities accordingly. They report significant improvements on several well-known benchmarks.
weaknesses: 1. Although the proposed approach is novel, some of the individual steps are not sufficiently motivated. For example:

1.1. "Eq. 9 downweighs the classes that appear most uniformly and it upweighs the classes that appear less uniformly. In practice, this scheme enforces a centre bias for frequent classes and no bias for rare classes, as shown in Fig. 2-bottom-right. Intuitively, removing the bias from the rare classes is better than rectifying it because it produces balanced detectors and aligns better with the target distribution as shown in our ablation and our qualitative results." => It is not clear why this is enforced. Can we not have frequent classes that have some spatial bias (other than the center?) or that are uniformly sampled?

1.2. Figure 4d-e: The implication of weak correlation between n(y) and Phi(y) should not be surprising since the fractal definition in Eq 8 does not depend on the number of occurrences in a cell (since an indicator function is used). However, it is not clear why this is preferred.

2. Fractal dimension measures the uniformity of spatial distributions. Is this the best choice for this purpose, considering its limitations (not being able to take the limit on G, thresholding it and fitting a line etc.)? One could use many different methods available for measuring dispersion.

3. The extension to the binary case in Eq 11 appears ad hoc and is not justified properly.