# A Robust Multi-Camera Vehicle Tracking Algorithm in Highway Scenarios Using Deep Learning
## 3 Methods
### DLA-Efficient
The Re-ID branch of the FairMOT-MCVT algorithm integrates a triplet loss function and a temporal continuity loss function. This combination aims to tackle issues related to the uniqueness and consistency of target tracking and challenges in predicting abrupt changes in motion. Doing so prevents tracker failures caused by variations in the target appearance and reduces instances of trajectory discontinuity and prediction errors. The triplet loss function optimizes the feature space by minimizing the distance between samples of the same class and maximizing the difference between samples of different classes. This enhancement aids the network in learning to track the same target consistently across different frames. The equation is as follows:

Figure 3.3

where \(f(x)\) represents the feature extraction function, which converts the input image \(x\) into a feature vector, \(\parallel f(a)-f(p)\parallel_{2}^{2}\) is the square of the Euclidean distance between the anchor point and the positive sample, \(\parallel f(a)-f(n)\parallel_{2}^{2}\) is the square of the Euclidean distance between the anchor point and the negative sample, and \(m\) is a boundary value (margin) used to ensure that the distance between the anchor point and the negative sample is at least \(m\) greater than the distance between the anchor point and the positive sample. The temporal continuity loss function integrates trajectory smoothing loss [40] and velocity continuity loss [41] to enhance the tracker's predictive capabilities. It emphasizes the target's consistent motion between consecutive frames, ensuring a stable trajectory even in complex scenarios. The formula of \(L_{cont}\) is as follows:

Figure 3.4

where \(p_{i}\) and \(p_{i+1}\) are the predicted positions of the vehicle in two consecutive frames, respectively, \(v_{i}\) and \(v_{i+1}\) are the calculated speeds of the vehicle in two consecutive frames, respectively, which can be calculated by \(v_{i}=p_{i}-p_{i-1}\), and \(N\) is the frame number range that considers continuity and is usually chosen to be dynamically adjusted based on the video frame rate and scene. \(\alpha\) and \(\beta\) are the weight parameters that balance the importance of position smoothness and velocity consistency. Ultimately, by combining the \(Smooth_{L1}\) loss, the cross-entropy loss function, the ternary loss function, and the temporal continuity loss function, the joint loss function \(L\) is defined as follows:

\[ \begin{array}{ll}L=&+\lambda_{2}L_{reg}(b,g)+\lambda_{3}L_{reid}(f(a),f(p), f(n))+\lambda_{4}L_{cont}(t)\\ =&-\lambda_{1}[ylog(p)+(1-y)log(1-p)]+\lambda_{2}{\sum}_{i\in\{x,v,w,h\}}\ Smooth_{L1}(b_{i}-g_{i})\\ &+\lambda_{3}max\big{(}0,m+\parallel f(a)-f(p)\parallel_{2}^{2}-\parallel f(a )-f(n)\parallel_{2}^{2}\big{)}\\ &+\lambda_{4}\Big{(}\alpha{\sum}_{i=t}^{t+N-1}\parallel p_{i+1}-p_{i} \parallel_{2}^{2}+\beta{\sum}_{i=t}^{t+N-1}\parallel v_{i+1}-v_{i} \parallel_{2}^{2}\Big{)}\end{array}  \tag{7}\]

where \(L_{cls}(p,y)\) optimizes the classification task, \(L_{reg}(b,g)\) refines the precise location of the vehicle bounding box, \(L_{reid}(f(a),f(p),\ f(n))\) preserves the vehicle's ID across consecutive video frames [42], and \(L_{cont}(t)\) is an optional temporal continuity loss penalizing tracking inconsistencies. ## 4 Experimental Results and Discussion

### Datasets and Metrics

The FairMOT-MCVT vehicle tracking system is trained and evaluated using the UA-DETRAC dataset, which serves as a comprehensive benchmark for detecting and monitoring multiple objects in various real-world traffic scenarios. This dataset includes 60 video sequences depicting diverse weather and lighting conditions, such as sunny, cloudy, dark, and rainy. The videos are recorded at 960 \(\times\) 540 pixel resolution and 25 frames per second (FPS), totaling 144,000 frames across varying durations from 36 to 128 s. The object classes within the dataset encompass cars, buses, trucks, and others.