## 4 Method
### Inter-Part Relationship Extraction Module  
**Pedestrian Feature Segmentation. ** The purpose of this module is to segment pedestrian train features horizontally into multiple parts and then capture the relationships between different parts using an RNN network. However, we have observed that in open pedestrian scenes, pedestrians do not always occupy the entire image; instead, they often only occupy a small region of the image. Therefore, we map the pedestrian mask \(M\in\mathbb{R}^{H\times W}\) to the deep feature space \(F\in\mathbb{R}^{c\times h\times w}\), resulting in a new mask \(M_{F}\in\mathbb{R}^{h\times w}\). Based on \(M_{F}\), we extract pedestrian-specific features from \(F\) as \(F_{p\sigma}=F\cdot M_{F}\), and then further divide the pedestrian features horizontally into multiple parts. Figure 5 illustrates the process of pedestrian feature segmentation. First, we seek the smallest rectangular bounding box, denoted as \(Rec_{1}\), that covers the binary mask \(M\in\mathbb{R}^{H\times W}\) with values equal to \(1\). Assuming the top-left corner \(p_{1}\) of \(M\) is at coordinate \((0,0)\), the coordinates of \(Rec_{1}\) relative to \(P_{1}\) are given by \([x_{1},\,y_{1},x_{2},\,y_{2}]\), where \((x_{1},y_{1})\) represents the top-left corner, and \((x_{2},y_{2})\) represents the bottom-right corner. Next, we  
divide \(Rec_{1}\) horizontally into \(N\) equal parts. The \(i\)-th part, denoted as \(Rec_{1}^{i}\), has coordinates relative to \(P_{1}\) given by the following:  
\[\left[x_{1},\,y_{1}+\frac{(i-1)(y_{2}-y_{1})}{N},\,x_{2},\,\frac{(y_{2}-y_{1})i }{N}\right] \tag{7}\]  
For each \(Rec_{1}^{i}\), we find the smallest rectangular bounding box, denoted as \(Rec_{2}^{i}\), that covers the corresponding region in the mask with values equal to \(1\). Assuming the top-left corner \(p_{2}\) of \(Rec_{1}^{i}\) is at coordinate \((0,0)\), the coordinates of \(Rec_{2}^{i}\) relative to \(p_{2}\) are given by the following:  
\[\left[x_{1}^{i},y_{1}^{i},x_{2}^{i},y_{2}^{i}\right] \tag{8}\]  
Then, the coordinates of \(Rec_{2}^{i}\) relative to \(p_{1}\) are as follows:  
\[\left[x_{1}+x_{1}^{i},y_{1}+\frac{(i-1)(y_{2}-y_{1})}{N}+y_{1}^{i},x_{1}+x_{2} ^{i},y_{1}+\frac{(i-1)(y_{2}-y_{1})}{N}+y_{2}^{i}\right] \tag{9}\]  
Finally, by mapping \(Rec_{2}^{i}\) to the feature space \(F_{per}\), we obtain the pedestrian features corresponding to the respective regions. **Inter-part Relationship Modeling. ** Components based on foreground segmentation contain rich local features of pedestrians, and there are also potential dependencies between different components. In this research paper, we construct a feature extraction network for inter-component features using Gated Recurrent Units (GRU) to capture the dependencies between different components. GRU is an effective variant of recurrent neural networks (RNNs), and shares similarities with Long Short-Term Memory (LSTM) networks. By introducing gating mechanisms to control information flow, GRU effectively addresses the challenge of long-term dependencies inherent in traditional RNNs [31]. Notably, GRU exhibits comparable performance to LSTM while having a simpler structure and fewer parameters [32], making it a valuable tool in practical applications, particularly within the field of image processing. The structure of a Gated Recurrent Unit (GRU), as illustrated in Figure 6, comprises two essential components: the Reset Gate and the Update Gate. The reset gate determines how much of the previous hidden state should be retained when combining it with new input information. It controls the balance between preserving past context and adapting to new data. The update gate regulates how much of the previous hidden state should  
Figure 5: Pedestrian feature map segmentation (take \(N=4\) as an example). (**a**) Region of interest (ROI), (**b**) split the ROI into N parts, (**c**) part ROI (take \(P_{4}\) as an example), and (**d**) mapping part ROIs to the feature map. influence the current state.