# A Robust Multi-Camera Vehicle Tracking Algorithm in Highway Scenarios Using Deep Learning
## 3 Methods
### DLA-Efficient
```
**Algorithm 1**Block-Efficient Module

### DLA-MSDA

The MSDA attention mechanism is introduced after the DLA-34 network base. This mechanism effectively combines multi-scale features with attention weights to enhance the model's capability to capture and utilize feature information across various levels and scales, thereby improving the detection performance. The MSDA attention mechanism is shown in Figure 5.

The pseudo-code of the MSDA attention mechanism is shown in Algorithm 2. First, three multi-scale convolutional kernels with different dilation rates (1, 2, and 3) are initialized. Then, for each position in the input feature map (with shape B \(\times\) C \(\times\) H \(\times\) W), these three convolution kernels are applied separately to obtain the multi-scale feature maps F1, F2, and F3. These three feature maps are concatenated to form the joint feature map F_concat, and a channel attention mechanism is applied to obtain the weighted feature map F_weighted. Finally, the weighted feature map is normalized to produce the enhanced

Figure 5: The MSDA attention mechanism framework. feature map Y. The entire process iterates through all batches, channels, heights, and widths, ultimately returning the final enhanced feature map Y. ```
input: Feature map X of size B \(\times\) C \(\times\) H \(\times\) W output: Enhanced feature map Y
1: Initialize multi-scale convolutional kernels K1, K2, K3 with dilation rates of 1, 2, and 3. 2: for i \(\leftarrow\) 1 to B do
3: for j \(\leftarrow\) 1 to C do
4: for k \(\leftarrow\) 1 to H do
5: for l \(\leftarrow\) 1 to W do
6: F1 \(\leftarrow\) Conv(X[i, j, k, l], K1);
7: F2 \(\leftarrow\) Conv(X[i, j, k, l], K2);
8: F3 \(\leftarrow\) Conv(X[i, j, k, l], K3);
9: F_concat \(\leftarrow\) Concat(F1, F2, F3);
10: F_weighted \(\leftarrow\) ChannelAttention(F_concat);
11: Y[i, j, k, l] \(\leftarrow\) Normalize(F_weighted);
12: end for
13: end for
14: end for
15: end for
16: return Y;
```

**Algorithm 2****MSDA Attention Mechanism**

The FairMOT-MCVT formed by combining the above methods is shown in Figure 6. The Block-Efficient module can capture high-level semantic features, such as color, shape, size, and the spatial attributes of rigid objects. Employing the MSDA module reduces the computational load associated with additional convolutional layers, enhances the generalization capabilities, and maintains computational efficiency. ### Joint Loss Function

The method introduces deep cosine metric learning for calculating the similarity between two feature vectors, which is crucial in human re-identification. However, more than this approach is needed to track multiple vehicles effectively. Moving vehicles may appear similar but vary in angles, while modern cars often share similar colors, resulting in a high feature similarity. To address these challenges, a novel joint loss function is proposed, combining the Smooth\(L_{1}\) loss function and cross-entropy loss, formulated as:

Figure 6: The FairMOT-MCVT structure is comprised of three primary components: (1) the designed Block-Efficient structure is used in the front-end part of the model; (2) an embedded MSDA attention mechanism; and (3) a detection and Re-ID branch, which employs a suite of loss functions, including the Smooth\(L_{1}\), cross-entropy, and ternary loss functions. Additionally, the model incorporates a time-continuity loss function. Figure 3.0

where \(b=\left\{b_{x},\ b_{y},b_{w},b_{h}\right\}\) is the predicted bounding box (center coordinates, width, height), and \(g=\left\{g_{x},g_{y},g_{w},g_{h}\right\}\) is the corresponding real bounding box. \(Smooth_{L1}\) is defined as:

Figure 3.1

The cross-entropy loss measures the disparity between the predicted probability distributions and the actual labels. For the binary classification problem, the expression is as follows:

Figure 3.2

where \(p\) is the probability that the model predicts that the target is a vehicle, and \(y\) is the real label, 1 for vehicles and 0 for non-vehicles.