# AR Long-Term Tracking Combining Multi-Attention and Template Updating
## 3 Methods
### Feature Fusion
#### 3.2.1 Dual Self-Attention Module  
The dual self-attention module consists of a channel attention network and a Non-Local network. The attention mechanism is a good reference to people's ability to observe things and improves the defect of not being able to extract rich contextual information. It can better focus on useful information, so as to facilitate the tracker to avoid the interference of chaotic background information and improve tracking accuracy. Non-Local is a network which can capture long-distance dependencies between features at any location. Channel attention mechanisms can carry out adaptive weighting for each channel to improve the effective use of relevant channel information and enhance the characterization ability of the network. Therefore, a dual self-attention based on a Non-Local network and channel attention is designed to learn more contextual information. In this work, the Non-Local attention network made use of getting more spatial information. In addition, so as to better utilize effective channel responses, we choose channel attention to calculate the channel weight coefficient to weigh channels, reduce the influence of irrelevant channels, and increase the characterization ability of networks. The structure of the DSAM module is shown in Figure 2.  
The attention mechanism improves the defect that the feature extraction network cannot extract rich context information due to the limitation of the receptive field, better focuses on useful information, facilitates the tracker to avoid the interference of chaotic background information, and improves the tracking accuracy. The channel attention mechanism is used to address the issue of irrelevant channel information interfering with model calculation and negatively impacting target positioning accuracy. By weighing each channel adaptively, the effective utilization of relevant channel information is improved, the characterization ability of the network is enhanced, and the tracking accuracy is increased. The mechanism leverages location information to identify  
Figure 2: Dual Self-attention Module (DSAM). the richest part of the image information in each channel, thus complementing the channel's attention and helping distinguish the target from the complex background. The structure is illustrated in Figure 3.  
Non-Local attention network: different from traditional local operations such as convolution operation and cyclic operation, traditional convolution operation can only calculate the relationship between adjacent features, while Non-Local is a kind of network, which can capture the long-distance dependence relationship between any location features. Therefore, our work introduces a Non-Local network to extract location information. The structure is shown in Figure 4.  
The input of the Non-Local network is \(X1\in H_{X1}\times W_{X1}\times C\) and \(X2\in H_{X2}\times W_{X2}\times C\), respectively, and the input \(X1\) and \(X2\) are assigned to three matrices, namely, \(q\), \(k\), and \(v\), respectively, and \(q\), \(f\), and \(g\) are the convolution operators of \(q\), \(k\), and \(v\), respectively. After the \(1\times 1\) convolution of these three input matrices, the matrix transpose operation is carried out, and the matrix multiplication operation is carried out twice. After the \(1\times 1\) convolution, the addition of the original matrix \(X1\) is carried out to obtain the final output \(Z^{*}\). The expression is as follows:  
\[X2_{v}=g{(X2)}_{M}, \tag{1}\]  
\[X2_{k}=\phi{(X2)}_{M}{}^{T}, \tag{2}\]  
\[X1_{q}=\theta{(X1)}_{M^{\prime}} \tag{3}\]  
\[X1_{qk}=softmax(X1_{q}\cdot X2_{k}), \tag{4}\]  
\[X1_{qkv}=X1_{qk}\cdot X2_{v}, \tag{5}\]  
\[Z=\gamma(X1_{qkv}), \tag{6}\]  
Figure 2:0 Non-Local Network. Figure 2:1 Channel Attention.