# Non-Local Spatial and Temporal Attention Network for Video-Based Person Re-Identification
## 4 Experiment
### Result  
In our experiments, first, every video of the person was divided into multiple sequences containing N frames, then each sequence was passed through the network to obtain sequence-level features, and finally, the sequence-level features were averaged to obtain a video-level descriptor. We used the \(L_{2}\) distance to calculate CMC and mAP. The following is a comparative analysis of some experimental data:  
Location of the NLAM within the network: In the first step, we explored the effect of NLAM at different locations within the network. We inserted an NLAM layer after one or more feature extraction CNN blocks to compare their capability. In order to ensure the uniqueness of variables, we used NLTP as the temporal aggregation layer. The network was trained and tested on two datasets, MARS and DukeMTMC-VideoReID. The results are shown in Table 3. It can be derived from Table 3 that when we added a single NLAM layer to the network, the network performed better when inserted into deeper blocks (e.g., block3, block4, block5). So, we tested the insertion of multiple NLAM layers for the deeper blocks in Table 4. We found that inserting the NLAM layer after block4 and block5 achieved the best results. The results are as follows: \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Location**} & \multicolumn{4}{c}{**MARS**} & \multicolumn{4}{c}{**Duke**} \\ \cline{2-10}  & **mAP** & **R1** & **R5** & **R20** & **mAP** & **R1** & **R5** & **R20** \\ \hline
3,4 & 79.3 & 86.1 & 94.9 & 97.6 & 94.0 & 94.2 & 98.9 & 99.8 \\
3,5 & 79.5 & 85.3 & 95.7 & 97.7 & 94.0 & 94.8 & 99.1 & **99.9** \\
4,5 & 79.8 & **86.3** & **95.8** & **97.8** & **94.5** & 95.0 & **99.3** & **99.9** \\
3,4,5 & **80.1** & 86.0 & 95.5 & 97.4 & 94.4 & **95.1** & 99.0 & **99.9** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Evaluation of the effect of inserting a single NLAM layer after different CNN blocks simultaneously. The number in the location column indicates that the NLAM layer is added after these CNN blocks. For example, \({}^{3}\),\(A^{\prime}\) represents that an NLAM layer is inserted after the third and fourth CNN blocks, respectively. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Location**} & \multicolumn{4}{c}{**MARS**} & \multicolumn{4}{c}{**Duke**} \\ \cline{2-10}  & **mAP** & **R1** & **R5** & **R20** & **mAP** & **R1** & **R5** & **R20** \\ \hline
2 & 70.6 & 80.6 & 92.3 & 96.3 & 92.7 & 94.0 & 98.8 & 99.6 \\
3 & **79.5** & 85.7  
Different temporal aggregation methods: In order to directly compare the superiority of our proposed NLTP feature aggregation method, we compared our proposed method with the temporal pooling method used in the baseline (Table 1). Both experiments were conducted based on using SE-ResNet50 as the feature extractor and adding the NLAM module after the fourth and fifth CNN layers to make sure there was only one variable. Table 5 shows the performance evaluation of the model. Compared with the temporal pooling method, our proposed NLTP method achieved a better performance. Especially on the MARS dataset, NLTP improved mAP by 0.2% and increased the accuracy of rank-1 by 0.5%. The specific data are shown in Table 5.  
Effect of different sequence lengths (N): In this step, we studied the impact of the different number of frames in each sequence on our model. N represents the length of the sequence which is the number of frames we captured from a video. We compared the performance of the model on the MARS dataset at N = 2, 4, 8, and the results are shown in Table 6. In order to ensure the uniqueness of the experimental variables, we conducted an experimental comparison based on the SE-ResNet50 with the NLAM module added after the fourth and fifth CNN layers as the feature extractor and NLTP as the temporal aggregation layer. It can be seen from Table 6 that our network achieved a better performance when N = 8, which is different from the conclusion in our baseline (the model performs best when N = 4).