# Highly Accurate Deep Learning Models for Estimating Traffic Characteristics from Video Data
## 3 Methodology
### Video Detection and Tracking Algorithm  
The primary purpose of this study is to develop a real-time efficient object tracking algorithm from video data. Conventional tracking methods employ batch-based algorithms [7]. However, these methods may not always fulfil real-time requirements in situations where there are numerous objects present. This could be attributed to (i) features that are not shared and (ii) the re-ID process being repeated. Recently, an object tracking algorithm known as fairness multi-object tracking (FairMOT) has been developed to perform cross-frame object association to accelerate processing speed. However, the algorithm needs to be modified, as the following fundamental issues for detecting and tracking moving vehicles should be addressed:  
* Simultaneously detecting and re-identifying (re-ID) tasks
* Effectively fusing aggregated features
* Person re-ID vs. vehicle re-ID
* Faster learning ability
* Generating high-quality re-ID features  
Therefore, a modified FairMOT is developed in this paper. The advantage of using the FairMOT network is that it can jointly integrate and balance the detection and re-ID tasks. For detecting moving objects, the anchor-free centrenet method is integrated with FairMOT [7]. The backbone network of FairMOT, known as Resnet34 with deep layer aggregation (DLA), is normally employed to fuse aggregated features [7]. However, this is particularly effective in person re-identification (person re-ID). Therefore, the backbone network in FairMOT was replaced with 'Darknet53' to enhance vehicle detection and re-identification (see Figure 1) [7]. Although Darknet53 has a residual block similar to that of Resnet34, it employs densely connected layers to extract object features. We have also utilised a cross-stage partial network (CSPNet) to maximise the differences between gradient joints and prevent different layers from learning repeated gradient information. This addresses the problems relating to (i) massive computation and (ii) gradient diffusion. Consequently, the learning ability of the network can be greatly improved by integrating Darknet53 with the CSPNet. In addition, DLA is also used to fuse aggregated features for generating high-quality re-ID features.  
Therefore, we modified the existing FairMOT network to efficiently track any moving objects, vehicles, and people. The FairMOT network is considered to be the state-of-the-art tracking model in multi-object detection, and its modified version developed in this paper, termed the modified FairMOT (mFairMOT) network, further increases model generalisability in tracking different types of objects. The structure of the mFairMOT is schematically developed in Figure 2.  
Figure 2: Modified FairMOT (mFairMOT) network structure (CBL: block for convolution+batch normalisation+Leaky_Relu; Res Unit: residual block unit; Leaky Relu: an activation function; BN: batch normalisation; CSP: cross-stage partial network; SPP: spatial pyramid pooling).  
As shown in Figure 2, the input image is first fed to an encoder-decoder network to extract high-resolution feature maps. The encoder-decoder network is composed of densely connected layers with the combination of the Focus layer, CBL block, CSP network, and ReLu activation function. Two homogeneous branches were then added for detecting objects and extracting re-ID features, respectively. The detection branch is to obtain object-detected frames, and the re-ID branch is for tracking purposes and assigns a unique ID to each tracked object to depict its trajectory. The features at the predicted object centres are used for tracking.