# Target-Aware Feature Bottleneck for Real-Time Visual Tracking
## 3 Proposed Method
### Training the Proposed Framework  
Herein, we provide the details that are relevant to training our overall tracking framework, where we describe the loss functions and optimization method that are used for training the overall tracking model. We apply loss functions on the outputs of the RPN and the region classifier net, where the target-adaptive feature bottleneck module is iteratively optimized from the transferred gradients obtained by optimizing the subsequent prediction head networks. To train the region proposal network with two branches shown in Section 3.1, we enforce loss functions on the outputs of both branches \(f^{p}_{C},f^{p}_{R}\), which are \(y_{C}\in\mathbb{R}^{h\times w\times 2}\), \(y_{R}\in\mathbb{R}^{h\times w\times 4}\) as in  
\[L^{P}(\{y_{C},y^{*}_{C}\},\{y_{R},y^{*}_{R}\})=\frac{1}{hw}\sum_{i,j}L^{P}_{ \mathrm{c}}(y^{(i,j)}_{C},y^{*(i,j)}_{C})+\frac{\lambda_{P}}{N_{P}}\mathbf{1}_ {\{y^{*(i,j)}_{C}>0\}}\sum_{i,j}L^{P}_{\mathrm{R}}(y^{(i,j)}_{R},y^{*(i,j)}_{R}) \tag{10}\]  
where the superscript \((i,j)\) denotes a spatial position in the output maps; \(y^{*}_{C},y^{*}_{R}\) denote corresponding ground truth maps; and \(N_{P}\) is the number of positions in the ground truth classification map \(y^{*}_{C}\) with positive labels \(y^{*(i,j)}_{C}>0\). For the output of classification branch \(y_{C}\), focal loss [63] is used to compensate for class imbalance, where \(L_{C}^{p}\) is applied on all locations \((i,j)\) in the output as in  
\[L_{C}^{p}(y_{C}^{(i,j)},y_{C}^{*(i,j)})=-(1-y_{C}^{*(i,j)})y_{C}^{(i,j)\gamma} \log(1-y_{C}^{(i,j)})-y_{C}^{*(i,j)}(1-y_{C}^{(i,j)})^{\gamma}\log(y_{C}^{(i,j )}), \tag{11}\]  
in which \(\gamma\) is a focus hyperparameter for controlling the importance between easy and hard targets. For the output of the regression branch \(y_{R}\), the loss is only enforced on locations in the positive region (\(y_{C}^{*(i,j)}>0\)) where our goal is to maximize the intersection-over-union (IoU) overlap between the ground truth and predicted bounding boxes as in  
\[L_{R}^{p}(y_{R}^{(i,j)},y_{R}^{*(i,j)})=1-\frac{|b_{R}^{(i,j)}\cap b_{R}^{*(i,j )}|}{|b_{R}^{(i,j)}\cup b_{R}^{*(i,j)}|}, \tag{12}\]  
where \(b_{R}^{(i,j)},b_{R}^{*(i,j)}\) denote the predicted bounding box and ground truth bounding box made from the values \(y_{R}^{(i,j)},y_{R}^{*(i,j)}\in\mathbb{R}^{4}\), respectively. \(|\cdot|\) denotes the total area size of a given region, \(\cap\) represents the overlap operation (intersection) between two regions, and \(\cup\) is the union operation over two regions. From the region proposals generated by the region proposal network, candidate features are spatially pooled and correlated with the target feature representation and fed to the region classification branches \(f_{D}^{Q},f_{S}^{Q}\), where the loss is enforced on the outputs \(y_{D}\in\mathbb{R}^{N\times 2}\) and \(y_{S}\in\mathbb{R}^{N\times 4}\) as in  
\[L^{Q}(\{y_{D},y_{D}^{*}\},\{y_{S},y_{S}^{*}\})=\frac{1}{N}\sum_{i}L_{D}^{Q}( y_{D}^{i},y_{D}^{*i})+\frac{\lambda_{Q}}{N_{Q}}\mathbf{1}_{\{y_{D}^{i}>1\}} \sum_{i}L_{S}^{Q}(y_{S}^{i},y_{S}^{*i}), \tag{13}\]  
where \(i\) indicates the index of a candidate ROI; \(y_{D}^{*},y_{S}^{*}\) denote the corresponding ground truth labels; and \(N_{Q}\) denotes the quantity of ROI regions that are positively labeled \(y_{D}^{*i}>1\). The ground truth classification label \(y_{D}^{*i}\) is determined by the IoU value of the RoI where \(y_{D}^{*i}=1\) is assigned to RoIs exceeding a threshold value \(\tau_{p}=0.5\), and \(y_{D}^{*i}=0\) is assigned to RoIs below a threshold value \(\tau_{n}=0.4\). For the output of the classification branch \(y_{D}\), focal loss is also used as in Equation (11) where the same \(\gamma\) is used. For the output of the bounding box refinement branch \(y_{S}\), \(L_{1}\) loss is enforced as in  
\[L_{S}^{Q}(y_{S}^{i},y_{S}^{*i})=||y_{S}^{i}-y_{S}^{*i}||_{1}, \tag{14}\]  
which is a standard \(L_{1}\) distance between two vectors, to minimize the distances for four corners of the bounding box coordinates.