## 3 Model and Methods
### Multi-Granularity Module
For the video sequence \(v\), the set of granular tokens \({z_{\text{med1}}}\) and \({z_{\text{med2}}}\) in the two groups that obtain \(t\) frames of images can be expressed as follows:  
\[{z_{\text{med }x}}=\left\{\Phi^{c}{}_{\text{med }x,1}^{l},\Phi^{c}{}_{\text{med }x,2}^{l},\cdots,\,\Phi^{c}{}_{\text{med }x,l}^{l}\right\},x=1,2 \tag{8}\]  
For fine-grained tokens, we use a window of size \((H/4)\times(W\times p)\) to divide \({z_{n}}^{l}\) into four parts. As with the operations for medium-grained tokens, four sets of fine-grained tokens (\({z_{\text{fin}1}}\), \({z_{\text{fin2}}}\), \({z_{\text{fin3}}}\), and \({z_{\text{fin4}}}\)) are finally obtained after the \(l_{\text{fin}}\) layer operation in the backbone transformer, which can be expressed as:  
\[{z_{\text{fin }x}}=\left\{\Phi^{c}{}_{\text{fin }x,1}^{l},\Phi^{c}{}_{\text{fin }x,2}^{l},\cdots,\Phi^{c}{}_{\text{fin }x,l}^{l}\right\},x=1,2,3,4 \tag{9}\]  
For the \(n\)-th frame image in video sequence \(v\), the extraction process of three different kinds of granularity tokens is shown in Figure 4.  
Figure 4: The extraction process of three different kinds of granularity tokens. When compared with tokens with a global level of granularity, tokens with a finer level of granularity can extract and learn more detailed features locally in an image, meaning that they have better local feature awareness and can obtain multi-granular feature information. Thus, after learning a whole video sequence, such tokens can also distinguish people. In a video sequence, an image is affected by changes in illumination, shooting angle, occlusion, and other factors. Thus, each image in a frame provides different information on an overall feature. Nonetheless, when people observe a video sequence of person recognition, they can determine the integrity and importance of a feature in each image according to the image and information in each successive frame. This inspires us to design a way of aggregating granular tokens of the same category along a video sequence in terms of 'importance'. We measure importance by the cosine similarity between the same category of granular tokens and aggregate them as a weighted sum. Finally, we combine the three granularity tokens horizontally to form a set of multi-granular tokens \(Z\), which represents the overall feature of video sequence \(v\). The calculations involved are as follows:  
\[\rho^{\prime}_{\textit{{glu}}_{  
The MARS dataset is a video extension of the Market-1501 dataset and contains more than one million frames of people images, making it the largest publicly available video-based dataset. The data were collected by six cameras on the campus of Tsinghua University. The dataset contains 20,478 video sequences of 1261 identities: 625 identities for training and 636 identities for testing. The video sequence of each identity was captured by at least two cameras. The large amount of image information was processed by the deformable parts model detector and generalised maximum multi-clique problem tracker, and there are errors and poor execution in the figure cutting. The iLIDS-VID dataset was collected in an aviation terminal hall, with the video sequence collected by two cameras with non-overlapping shooting fields. The dataset contains 300 identities and each of the two cameras captured a video sequence of 23-192 frames for each identity. Each video sequence has an average of 100 image frames. Although iLIDS-VID is a small dataset, with only 300 independent identities, the video sequence contains a large number of people wearing similar clothes and with overlapping occlusion, background clutter, and obvious lighting changes; these features make it a highly realistic and challenging dataset for Re-ID tasks. The PRID-2011 dataset was collected and collated by the Austrian Institute of Technology University, Austria. The video sequences were collected at crosswalks and sidewalks by two surveillance cameras with non-overlapping shooting fields. Each video sequence contains 5-675 frames of images, with an average of 100 frames.