# A Novel Dual Mixing Attention Network for UAV-Based Vehicle Re-Identification
## 3 Proposed Method
### Channel Mixing Attention  
Channel mixing attention splits the feature map along the channel. Then, progressively merge the channel and spatial attention to obtain the CMA. The model can understand and represent the input data more comprehensively through this synthesis, improving features' distinguishing ability and generalization performance.  
CMA is broken down into three phases as depicted in Figure 3: Firstly, the dimension of channel subfeature \(\mathbf{x_{c}^{i}}\) is \(C/N\times H\times W\), splitting along the channel into feature maps \(\mathbf{x_{c_{0}}^{i}}\) and \(\mathbf{x_{c_{1}}^{i}}\), as the input feature maps of space and channel attention. Secondly, the spatial input feature map \(\mathbf{x_{c}^{i}}\) is multiplied by group norm (\(G_{n}\)) and shuffing (\(S_{f}\)) to extract the features of \(\mathbf{x_{c}^{i}}\) space. More discriminative features are extracted by focusing on the critical space areas of vehicles through spatial attention. \(G_{n}\) calculates the mean and standard deviation, and divides the channels of each sample feature map into \(G\) groups. Each group will have \(C/G\) channels and then calculate the mean and standard deviation of the elements in these channels. Each group of channels is normalized independently with its corresponding normalization parameters. The formula for \(G_{n}\) is as follows:  
\[G_{n}(X)=\frac{1}{\delta}(X-\mu), \tag{1}\]  
where the parameter \(\mu\) represents the mean, and the parameter \(\delta\) illustrates the variance. The formula for \(\mu\) is as follows:  
\[\mu(x)=\frac{1}{(C/G)HW}\sum_{h=1}^{H}\sum_{w=1}^{W}X. \tag{2}\]The formula for \(\delta\) is as follows:  
\[\delta(x)=\sqrt{\frac{1}{\left(C/G\right)HW}\sum_{h=1}^{H}\sum_{w=1}^{W}\left(X- \mu(x)\right)^{2}+\varepsilon}, \tag{3}\]  
and the parameter \(\varepsilon\) is a tiny constant. [PERSON] uses variable parameters to extract the feature weights of the subspace so that the model can better filter and focus on essential feature channels. The calculation formula is as follows:  
\[S_{f}(x)=weight\times x+bias. \tag{4}\]  
In the above equation, parameters \(weight\) and \(bias\) are variable parameters. By calculating the weight of each channel in the feature graph, it is possible to assign different importance to the features of different channels. The model's performance can be improved by focusing more intensively on the feature channels that are more helpful to the task.  
In another branch, feature map \(\mathbf{x_{c_{1}}^{i}}\) is sequentially subjected to adaptive average pool (\(A_{p}\)) and shuffling. The output is multiplied by feature map \(\mathbf{x_{c}^{i}}\) to extract the spatial features of \(\mathbf{x_{c}^{i}}\) feature maps. Spatial attention learns the importance of different locations and weight features according to this importance. \(A_{p}\) changes the dimensions of feature map \(\mathbf{x_{c_{1}}^{i}}\) from \(C/2N\times H\times W\) to \(C/2N\times 1\times 1\), which is used to extract the spatial features of the feature map.  
Finally, the output dimension after concat is \(C/N\times H\times W\). The output feature map \(\mathbf{x_{c_{out}}^{i}}\) contains attention to feature graph channels and spaces. By mixing channel and spatial attention, the model can focus more precisely on different channels, locations, and correlations. The model can better adapt to different scales, shapes, and positions of vehicles photographed by UAVs.