## 2 Explaining BBRefinement
### The Principle of BBRefinement  
Firstly, let us suppose a convolutional neural network \(\mathbb{F}\) which is a set of \(k\) layers, \(\mathbb{F}=\{f_{1},f_{2},\ldots,f_{k}\}\). Such a neural network is generally called a backbone and maps an input image iteratively into a feature space. Here, we suppose \(e_{k}:D\subset\mathbb{R}^{n_{k}}\to L\subset\mathbb{R}\) to be an embedding of the \(k\)-th layer created as \(e_{k}(f_{k})=p(f_{k})\), where \(p\) is a global average pooling or flattening operation. Furthermore, we suppose a fully connected network \(\mathbb{G}\) to be a set of \(j\) layers, \(\mathbb{G}=\{g_{1},g_{2},\ldots,g_{j}\}\). According to the motivation, we propose to use mixture data as input to the suggested refinement scheme. The convolution neural network \(\mathbb{F}\) processes the input image (crop with fixed resolution) containing an object, and a fully connected neural network \(\mathbb{G}\) processes a fixed-size vector that contains information about the class and the center of the object. Both networks are designed to \(|e_{k}(f_{k})|=|g_{j}|\) to be valid, where \(|\cdot|\) denotes cardinality. Then, both pieces of information are mixed as \(x=e_{k}(f_{k})\cdot g_{j}\), where \(\cdot\) is a dot product (see Figure 4). Such an operation can also be viewed as a kind of attention mechanism [15]. Finally, we connect \(x\) to the output layer \(o\) consisting of four neurons (to produce \((x,y,w,h)\)) and utilize the sigmoid activation function. The constructed neural network is trained in a fully end-to-end supervised scheme. From a practical point of view, we can use an arbitrary SOTA backbone such as ResNeSt, ResNeXt, or EfficientNet, to mention a few. For BBRefinement, we use EfficientNet [16] because of its easy scalability. In the benchmark section, we present the results for versions B0-B4. According to the version, the input image's resolution is \(224^{2}\), \(240^{2}\), \(260^{2}\), \(300^{2}\), and \(380^{2}\). The version affects \(|e_{k}(f_{k})|\) as well, and it is 1280 (B0 and B1), 1408, 1536, and 1792. There are several options for defining the loss function \(\ell\) used to train BBRefinement. The first option is to compare each normalized coordinate of the box with the GT label using, e.g., binary cross-entropy (BCE). The second option is to use BCE to compare top-left points and then the Euclidean distance to evaluate the width and height of a box. This approach is used, e.g., in YOLO [17]. The third way is to use the coordinates of all points to determine the boxes' areas and compute IoU, which we also use in BBRefinement. We have two available options for defining the IoU loss function, namely, \(\ell_{1}(\mathbf{b},\mathbf{b}^{\prime})=-log((i(\mathbf{b},\mathbf{b}^{ \prime})/u(\mathbf{b},\mathbf{b}^{\prime}))\) for the logarithmized form and \(\ell_{2}(\mathbf{b},\mathbf{b}^{\prime})=1.0-i(\mathbf{b},\mathbf{b}^{\prime})/ u(\mathbf{b},\mathbf{b}^{\prime})\) for the linear form, where \(i\) represents the intersection of two boxes, \(u\) their union, \(\mathbf{b}\) is the GT box, and \(\mathbf{b}^{\prime}\) predicted box. The logarithmized form is suitable for tasks where the mAP is measured with respect to a single low IoU threshold, such as 0.5, because it pushes bad predictions over this threshold and does not give much attention to good predictions. The linear form improves all predictions equally, which is beneficial for tasks where the mAP is computed for several IoU thresholds, such as 0.5,..., 0.95, which is the case of the COCO evaluation script; thus, we use the linear form. Note that both forms of the loss function can be based on a more efficient version of the IoU, such as Generalized IoU loss [18], Complete IoU, or Distance IoU [19]. The pipeline for the prediction with BBRefinement is illustrated in Figure 5 and is as follows. A generic object detector takes an input image and detects boxes. Their coordinates are used to take crops from the original input image. The crops are then rescaled to the BBRefinement input resolution.