# MFCNet: Mining Features Context Network for RGB-IR Person Re-Identification
## 3 Our Method
### The Proposed MFCNet
The detailed structure of the SGA module is shown in Figure 3. For the input features \(F\in\mathbb{R}^{C\times H\times W}\), the attention map \(A(F)\in\mathbb{R}^{C\times H\times W}\) is obtained after learning by the attention module. We use the following formula to calculate the resulting feature set \(F^{\prime}\):  
\[F^{\prime}=F+F\otimes A(F) \tag{1}\]  
where \(\otimes\) represents elementwise multiplication. Inspired by residual learning, we add the features learned by the attention module to the original features to retain information. The attention module designed in this paper is divided into two branches to learn more the most critical areas of images. The upper part of the figure is the spatial attention branch, and the lower part is the global attention branch. The attention map learned by the spatial attention branch is \(A_{S}(F)\in\mathbb{R}^{1\times H\times W}\), and the attention map learned by the global attention branch is \(A_{G}(F)\in\mathbb{R}^{C\times 1\times 1}\). Therefore, we get can obtain \(A(F)\):  
\[A(F)=\delta(A_{S}(F)+A_{G}(F)) \tag{2}\]  
where \(\delta\) is the sigmoid activation function. **Spatial attention branch. ** The spatial attention [39; 41] branch aims to improve feature expression in key areas. In essence, it converts the spatial information in the original image to another space to preserve the key information, generates a weight mask for each position and weights the output to enhance key areas and weaken noncritical background areas. Compared with other attention mechanisms, the spatial attention mechanism focuses on \"where\", which requires a larger receptive field to obtain more information. For the input  
Figure 3: SGA framework diagram. In this paper, MFCNet includes two parts: spatial attention and global attention parts. Given the feature map F, the module calculates the relevant attention matrix through two attention branches: the spatial attention branch \(A_{s}(F)\) and the global attention branch \(A_{G}(F)\). There is a hyperparameter, the dimensionality reduction rate \(m\) in the spatial attention branch; it is set to 16 in this paper. feature \(F\in\mathbb{R}^{\mathbb{C}\times H\times W}\), a \(1\times 1\) convolution kernel is used to compress the cross-channel dimension and obtain a feature with a dimension of \(\mathbb{R}^{\frac{\mathbb{C}}{n}\times H\times W}\). Then, two \(3\times 3\) small-scale convolution kernels are used to obtain a larger receptive field and capture key areas in this paper. Finally, the channel features are integrated and compressed through the \(1\times 1\) convolution kernel, and a spatial attention matrix of dimension \(\mathbb{R}^{1\times H\times W}\) is obtained. After passing the BN layer, the obtained matrix is output for the next step in the fusion process. The formula for the spatial attention mechanism is as follows:  
\[A_{S}(F)=BN(conv^{1\times 1}(conv^{3\times 3}(conv^{3\times 3}(conv^{1\times 1 }(F))))) \tag{3}\]  
where \(BN\) denotes a batch normalization operation and \(conv\) denotes a convolution operation. Discriminant feature representations are essential for RGB-IR Re-ID and can be obtained by capturing long-range contextual information. In order to model rich contextual relationships over local features, we introduce a global attention module. The global attention module encodes a wider range of contextual information into local features, thus enhancing their representation capability. Next, we elaborate the process to adaptively aggregate spatial contexts. _Global Attention Branch._ In this paper, the global attention [17; 23; 42] mechanism uses global contextual information to recalibrate the weights of different channels and adjust the channels' dependence levels. In general, this mechanism can be summarized into three steps: (1) context modeling, (2) feature conversion, and (3) feature fusion.