# Instance Hard Triplet Loss for In-video Person Re-identification
## 4 Experiments
### In-video ReID Results  
We also investigated the generality of our novel loss function and the efficiency of the ReID-Head network for the in-video ReID task. We trained our ReID-Head network with different \(K\) in the \(PK\)-sampling strategy for the ablation study, where \(K\) is the number of images for each person in a mini-batch. The results are shown in Table 3. As we can see, when \(K=2\), the ability of hard example mining could not be fully utilized, thus resulting in an inferior performance. When \(K=8\), the time span was large, so a more diverse appearance could be seen in the training time. However, in this way, as we discussed in the Introduction part, short-term features were discarded. When K was very large, the task was more like a cross-camera ReID, but without a camera difference, viewpoint changes, and scene transition. In our in-video ReID problem, we cared more about ReID in the next few frames, so too big \(K\) was unnecessary, and note that we only had a length of about 31 labeled frames in each video. Therefore, in the following experiments, we chose \(K=6\). We also evaluated the results using two sets of bounding boxes in the gallery: one was detected using the SSD trunk, and the other was the labeled ground truth. As shown in Table 4, using the labeled bounding boxes yielded a much better result, which revealed the huge influence of the detection accuracy on ReID performance. With better detection, we could achieve a better ReID result, because a good bounding box contained more body areas and less background distracting information. Some examples of both detected and labeled results are shown in Figure 6. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Method** & **Market-1501** & **DukeMTMC-reID** & **CUHK03** & **Time** \\ \hline BHT [14] & 85.9 & 78.1 & 58.6 & 0.81s \\ IHT (ours) & 87.0 & 80.3 & 59.2 & 0.53s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of two loss functions on the IDE [30] network for the cross-camera ReID task. Rank-1 accuracy is reported. The time for an iteration (forward + backward time) was tested on an NVIDIA Titan Xp GPU. Our proposed instance hared triplet loss achieved a better performance with less training time. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**K** & **G = 1** & **G = 5** & **G = 10** & **G = 15** \\ \hline
2 & 39.1 & 37.9 & 36.3 & 34.9 \\
4 & 39.9 & **39.2** & 37.8 & **36.4** \\
6 & **40.0** & **39.2** & 37.8 & 35.9 \\
8 & **40.0** & 39.0 & **37.9** & 36.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Experimental results on PoseTrack-ReID with different \(K\) values by our ReID-Head network. \(K\) is the number of images for each person in a mini-batch, and \(G\) is the frame interval. Rank-1 accuracy is reported. Many failure cases were caused by the wrong detection, as shown in the first column of Figure 6; all candidate bounding boxes were wrong, so the ReID-Head could not find a correct match. Detection affected ReID so much that we designed our ReID-Head as a separate independent module. Unlike some other rigid network designs, in this way, as the detection area progressed, we could constantly shift to the new better detection frameworks and achieve a better ReID performance. Moreover, our ReID-Head could be plugged into both one-stage and two-stage detection networks with good flexibility. Another thing that needs to be mentioned is that rank-1 accuracy when \(G=1\) using labeled ground truth bounding boxes was as high as 99.5%. After investigating the image results, we found it normal because when \(G=1\), the query frame and that right after the next frame (gallery frame) were very similar. For a 24 fps video, \(G=1\) meant only a 1/24 second time interval, and the images did not change much. Therefore, the query and gallery images were almost the same. We also evaluated the performance of a state-of-the-art cross-camera ReID method, the PCB [2] model, on the in-video ReID task.