# FETrack: Feature-Enhanced Transformer Network for Visual Object Tracking
## 3 Proposed Method
### Network Architecture
Since the information interaction between the initial and dynamic templates strengthens the extracted target features, we perform a self-attention operation with the initial and dynamic templates jointly as both keys and values for each other (the dynamic template is the same as the initial template during initialization). Specifically, the self-attention feature for the initial template is calculated by obtaining the query \(q_{i}\) from the initial template tokens and the key \(k_{i}\) and value \(v_{i}\) from the initial and dynamic template tokens. This process can be expressed as follows:  
\[q_{i} \leftarrow\leavevmode\
obreak\ it \tag{1}\] \[k_{i}v_{i} \leftarrow[it;dt]\] (2) \[it^{{}^{\prime}} =it+MHSA(q_{i},k_{i},v_{i}) \tag{3}\]  
where \(MHSA(\cdot)\) denotes the function of the multi-head self-attention (MHSA) operation. Similarly, the self-attention feature for the dynamic template is calculated by obtaining the query \(q_{d}\) from the dynamic template tokens and the key \(k_{d}\) and value \(v_{d}\) from the initial and dynamic template tokens. This process can be expressed as follows:  
\[q_{d} \leftarrow\leavevmode\
obreak\ dt \tag{4}\] \[k_{d},v_{d} \leftarrow[it;dt]\] (5) \[dt^{{}^{\prime}} =dt+MHSA(q_{d},k_{d},v_{d}) \tag{6}\]  
As a result, both template images are enhanced through self-attention to acquire the pure template features, thereby reducing interference from the search region. At the same time, we take advantage of the bidirectional information interaction possessed by the one-stream pipeline and perform a deep interaction between the template and the search region features through cross-attention operations to extract target-oriented features in a mutually guided manner. Specifically, we obtain the query \(q_{c}\) from the dynamic template and search region tokens and then obtain the key \(k_{c}\) and value \(v_{c}\) from the initial template, dynamic template, and search region tokens. The cross-attention feature extraction process can be expressed as follows:  
\[q_{c} \leftarrow[dt;s] \tag{7}\] Figure 3:0 (8) Figure 3:1  
where \(\text{Softmax}(\cdot)\) represents the softmax activation function and \(A_{c}\) denotes the output of cross-attention, including the enhanced dynamic template features and search region features. Here, we select the dynamic template and search region to perform cross-attention operations. The reason is that a dynamic template enhanced with self-attention implies both the feature information of the initial template and the appearance change information of the target. Meanwhile, the search region features benefit from the aggregated features of both the initial and dynamic templates, resulting in more discriminative target-oriented features. Eventually, these enhanced search region features are fed into the decoder for subsequent prediction. **Decoder**. As shown in Figure 2, the decoder of FETrack is a causal transformer. Each transformer block contains a masked multi-head self-attention (MMHSA) layer, a multi-head self-attention (MHSA) layer, and a feed-forward network (FFN). Specifically, the decoder receives the token embeddings from a previous transformer block and uses the causality of MMHSA to ensure that the output of each token element only depends on its previous input tokens, thereby eliminating any interference from subsequent tokens. Then, the output of MMHSA is fused with visual features from the encoder to predict a more accurate bounding box. Finally, FFN is used to generate the token embedding of the next transformer block.