## 3 Proposed Algorithm
### Background Target Routing Algorithm
During iteration, the original weights are refreshed depending on the resemblance between each forecast capsule \(u_{t|b}^{i}\) and the squashed weighted average capsule \(v_{j}\). The update of the initial weight \(e_{t|b}\) can be expressed as:  
\[e_{t|b} = e_{t|b}^{i}+u_{t|b}^{i}\cdot v_{j} \tag{21}\]  
where \(v_{j}\) denotes the capsule obtained after compression with the squash function, as the next capsule \(j\) output. The larger \(u_{t|b}^{i}\cdot v_{j}\) is, the more consistent they are and the higher the preliminary weight \(e_{t|b}\) will be. The smaller \(u_{t|b}^{i}\cdot v_{j}\) is, the weaker their similarity is and the preliminary weight \(e_{t|b}\) decreases. In the iterative process, the similar directions of all predicted vectors are found, and coupling coefficients are learned to be obtained. Normalization is performed with softmax so that the sum of coupling coefficients from the feature capsule \(i\) to all capsules in the background at frame \(t\) is one. The coupling coefficient \(g_{t|b}^{i}\) is normalized weight, which is calculated as follows:  
\[g_{t|b}^{i} = \frac{\exp\left(b_{t|b}^{i}\right)}{\sum_{k}\exp\left(b_{t|b}^{ik} \right)} \tag{22}\]  
where \(g_{t|b}^{i}\) is the coupling coefficient, \(k\) is the number of initial weights, \(\exp(\cdot)\) represents the exponential function, and \(\sum\) stands for the summing operation. At the beginning, routing weights from each feature capsule to all background capsules may be equal. The total input to the next layer of capsule \(j\) is a weighted average of the output vectors predicted for that capsule by all capsules in the previous layer. This is specifically achieved as follows:  
\[o_{j} = \sum_{j}g_{t|b}^{i}u_{t|b}^{i} \tag{23}\]  
where \(o_{j}\) denotes the total input of capsule \(j\). The total input of capsule \(o_{j}\) is squashed so that the length is in the range of 0 to 1 to get the output. The squashing function acts similarly to the activation function of a convolutional neural network. It is expressed as:  
\[v_{j} =\text{squash}\big{(}o_{j}\big{)}= \frac{\big{\|}o_{j}\big{\|}^{2}}{1+\big{\|}o_{j}\big{\|}^{2}} \frac{o_{j}}{\big{\|}o_{j}\big{\|}} \tag{24}\]  
where \(v_{j}\) is the output of capsule \(j\) and \(o_{j}\) is the total input of capsule \(j\). When \(\big{\|}o_{j}\big{\|}\) tends to 0, \(v_{j}\) tends to 0. When \(\big{\|}o_{j}\big{\|}\) tends to +\(\infty\), \(v_{j}\) tends to 1. The squash function is able to compress the length and keep the direction of the vector unchanged. The decoders in Figure 1 belong to the decoder structure within the capsule network framework [40]. The background target capsule features generated are used to resize the output feature capsule through a decoder. Subsequently, these features are amplified by three transposed convolutional layers. Then, a standard convolutional layer is added with a convolutional kernel size of \(1\times 1\), a step size of 1, zero padding, and the number of output channels is 1. Finally, a single-channel background response map with the size of the search area is obtained. In Figure 1, the red portion of the Background Response Map indicates a highly responsive region as the background region, and the blue portion is a low responsive region as the target region. The parameters of the background response map were adjusted according to the literature [41] to derive the target response map. Loss functions include capsule loss and regression loss. The capsule loss is:  
\[\mathcal{L}_{cap}=\sum_{k}[R_{k}\text{max}\big{(}0,x^{+}-\|v_{k}\|\big{)}^{2}+ \lambda(1-R_{k})\text{max}\big{(}0,\|v_{k}\|-x^{-}\big{)}^{2}] \tag{25}\]  
where \(x^{+}\) is the current capsule presence value of 0.9, \(x^{-}\) is the current capsule absence value of 0.1, \(\lambda\) represents damage decrease weights for absent capsules, which are used to reduce the length of the numeric capsule vector with a value of 0.5. \(R_{k}\) has a value of 1 when the \(k\)-th capsule is present and 0 otherwise.