# Multi-Attention-Guided Cascading Network for End-to-End Person Search
## 3 Proposed Method
### Multi-Attention-Guided Re-Id Network
#### 3.2.2 Multi-Attention-Guided Module for Person Search  
According to the above analysis, person search network combines detection module and the semantic regions feature output by the aligning module, which focuses on the global features from the target person and the visual cues from the local region, respectively. In addition, it is essential to take into account the importance of significant discriminant information from each person to further improve the performance for the re-id stage. For the multi-attention module, MGCN divides the fine-grained feature extraction module into two parts to encourage re-id network focusing on salient features from different types for pedestrians (Figure 4). In order to generate the pedestrian's channel attention map, MGCN squeezes the spatial dimensions of the feature map by adopting the channel attention mechanism. Inspired by [41], we utilize the maximum pool and the average pool operations simultaneously to collect important clues about pedestrian features. Specifically, MGCN extracts two different spatial context descriptors through the two pooling operations mentioned above, which can be expressed as \(\tilde{G}^{c}_{max}\) and \(\tilde{G}^{c}_{avg}\). In order to generate a channel attention map \(A_{c}\in\mathbb{R}^{C\times 1\times 1}\), we use a shared network consisting of a multi-layer perceptron (MLP) with one hidden layer to process the descriptors. Finally, MGCN applies an element-wise summation operation to learn the feature vector, which can be defined as  
\[ \begin{split} A_{c}(\tilde{G})&=sigmoid(MLP( avgpool(\tilde{G})))+(MLP(maxpool(\tilde{G})))\\ &=sigmoid(W_{c1}(W_{c2}(\tilde{G})))+(W_{c2}(W_{c1}(\tilde{G}))) \end{split}  \tag{2}\]  
where \(sigmoid\) is the activation function. In a shared network, the size of the hidden activation is to as \(A_{c}\in\mathbb{R}^{C/r\times 1\times 1}\), where \(r\) presents the reduction ratio. \(W_{c1}\in\mathbb{R}^{C/r\times C}\) and \(W_{c2}\in\mathbb{R}^{C\times C/r}\) denote the different weights of MLP. For most attention-based feature extraction networks, one type of attention information is usually extracted in most situations, which has limited guidance for feature extraction. To address this issue, MGCN adopts  
Figure 4: Channel attention model. multiple attention modules to extract significant pedestrian features through two attention modules complementing each other (Figure 5). Therefore, we construct a spatial attention map by utilizing the spatial relationship between multiple pedestrian features, which focuses on the location of significant information and complements the channel attention information. First, MGCN applies the maximum pooling and average pooling procedures along the direction of feature channels to generate two attention maps, which are, respectively, represented as \(\hat{G}^{s}_{max}\) and \(\hat{G}^{s}_{avg}\). The resulting features are passed through a standard convolution layer to generate the spatial attention map \(A_{s}\in\mathbb{R}^{H\times W}\). \[ \begin{array}{l}A_{s}(\hat{G})=sigmoid(conv([(avgpool(\hat{G}));(maxpool( \hat{G}))]))\\ =sigmoid(conv([\hat{G}^{s}_{avg};\hat{G}^{s}_{max}]))\end{array}  \tag{3}\]  
where \(\hat{G}^{s}_{max}\in\mathbb{R}^{1\times W\times W}\) and \(\hat{G}^{s}_{avg}\in\mathbb{R}^{C\times W\times H}\) denote two 2D maps. _conv_ is a convolution operation. Above all, we obtain the channel attention representation \(A_{c}\in\mathbb{R}^{C\times 1\times 1}\) and spatial attention representation \(A_{s}\in\mathbb{R}^{1\times H\times W}\), respectively. Furthermore, the result of multi-attention module can be calculated as \(\hat{G}_{1}=A_{c}(\hat{G})\otimes\hat{G}\), \(\hat{G}_{2}=A_{s}(\hat{G})\otimes\hat{G}_{1}\), where \(\otimes\) means element-wise multiplication. \(\hat{G}_{2}\) denotes the attention map, which integrates information of multiple attention to obtain significant feature representation. It is worth noting that pixel-wise fusion operation ensures that the correlation map encodes the information from the key region.