# Multiple Pedestrian Tracking in Dense Crowds Combined with Head Tracking
## 3 Main Architecture
### Detector and Tracker
#### 3.1.3 Body Detector  
Several Fused GTs to One Proposal. The body detector needs to be competent in dense crowds, but the reality is the objects overlapped heavily in dense crowds, and it is difficult to deal with. Therefore, several ground-truth bounding boxes with high IoUs were fused together to one proposal in our method, each fused bounding box represented an independent object. The total objects after fusion are described as (4), where \(b_{i}\) is the proposed box, \(g_{i}\) is the ground-truth bounding box, and \(\mathcal{G}\) represents the set of all ground-truth bounding boxes. \(\theta\) is the threshold for IoU calculation. The fusing technique used here can effectively distinguish multiple overlapping objects. The detector obtains some sort of antiocclusion ability and achieve higher robustness. We have  
\[G(b_{i})=\{g_{i}\in\mathcal{G}|IoU(b_{i},g_{i})\geq\theta\}. \tag{4}\]  
The overall structure of the whole-body detector is shown in Figure 4. We used the following method to perform pedestrians' body detection.  
Predict Several Predictions for Each Proposal. There are multiple proposals for each picture, and the instance predictions of each proposal are represented by a set of predicted boxes as (5). Each predicted box is represented by \((c_{i},l_{i})\), where \(c_{i}\) is the predicted category with confidence, and \(l_{i}\) is the relative coordinates of the prediction, and \(K\) is a preset constant, indicating that each proposal can predict up to \(K\) predictions. We have  
\[P(b_{i})=\{(c_{i}^{(1)},l_{i}^{(1)}),(c_{i}^{(2)},l_{i}^{(2)}),...,(c_{i}^{(K) },l_{i}^{(K)})\}. \tag{5}\]  
To calculate the differences, the Earth Mover's Distance (EMD) method was introduced in our approach, which is essentially a vector similarity measurement that can be used to solve problems like Optimal Transport. Inspired by target detection algorithms such as [62; 63; 64], we used EMD Loss as the loss function for dense detection algorithm. The loss function is expressed as (6), where \(\pi\) represents a sequence of real numbers, and the value of the \(k^{th}\) item is the value \(k\), \(g_{\pi_{k}}\in G(b_{i})\), where \(g_{\pi_{k}}\) represents the \(k\)th ground-truth bounding boxes in the set of ground-truth, \(\mathcal{L}_{cls}\) and \(\mathcal{L}_{reg}\) represent the classification loss and the regression loss, respectively. We have  
\[\mathcal{L}(b_{i})=\min_{\pi\in\prod}\sum_{k=1}^{K}[\mathcal{L}_{cls}(c_{i}^{( k)},g_{\pi_{k}})+\mathcal{L}_{reg}(c_{i}^{(k)},g_{\pi_{k}})]. \tag{6}\]  
Patched NMS. The body detector adopt a patched version of Non-Maximum Suppression (NMS) when dealing with multiple bounding boxes with high overlaps. Specifically, when NMS suppresses one box for the other, it checks whether the two boxes belong to the same proposal by adding an additional test, and if so, skips the step. The patched NMS is used in conjunction with the fused examples, which has a significant effect in crowd detection.  
Refinement Model. Each fused example contained several bounding boxes, which may lead to a higher risk of false positives. Hence a supplementary refinement module might be added, and the module is optional according to the quality of output results. The structure of the refinement module is shown in Figure 4b, which takes the predictions as input and combines them with the proposal boxes, to correct the wrong predictions due to the fusion.