## 3 Proposed Vehicle Detection and Tracking Scheme
### Deep SORT Algorithm for Vehicle Tracking  
The tracking process in Deep SORT involves three main steps: detection, feature extraction, and data association. First, object detection is generated using an object detection algorithm like YOLOv5. Then, deep feature descriptors are extracted from the detected objects using a pre-trained deep neural network like ResNet. Finally, data association is performed to associate the detected objects across the frames, using a combination of appearance similarity and motion information. The obtained result of YOLOv5 is fed to the Deep SORT algorithm for tracking the vehicles. Initially, the Kalman filter is applied in Deep SORT to predict the trajectories of vehicles by analyzing the previous frames. Second, the Hungarian algorithm was applied to perform cascade matching and intersection over union (IOU) matching for the predicted trajectories of vehicles with the detected vehicles in the current frame, facilitating the accurate association and tracking of the vehicles. After matching the results of predicted trajectories with the detected vehicles, the object prediction in the current frame by the Hungarian algorithm is the same as the object in the previous frame. Later, it is used to perform association and assign IDs for vehicle tracking. Finally, the Kalman filter can be updated using Equations (1)-(5) for predictions [55; 56]. \[m_{y} =\mathrm{u}-\mathrm{V}m_{x}^{\prime} \tag{1}\]  
where \(m_{y}\) represents the predicted measurement or observation in the y direction; u stands for the true or actual measurement in the y direction; V denotes a matrix that relates the  
Figure 2: Methodological flow of the YOLOv5-based proposed model. state \(m^{\prime}_{x}\) to the measurement \(m_{y}\); and \(m^{\prime}_{x}\) represents the predicted state of the system in the x direction. \[\mathrm{G}=\mathrm{V}L^{\prime}V^{T} \tag{2}\]  
where G represents the covariance matrix of the measurement noise; V represents the matrix that relates the predicted state to the measurement; and \(L^{\prime}\) is the transpose of the covariance matrix of the predicted state. \[\mathrm{K}=L^{\prime}V^{T}G^{-1} \tag{3}\]  
where K denotes the Kalman gain, determining the amount of correction applied to the predicted state; \(L^{\prime}\) denotes the transpose of the covariance matrix of the predicted state; \(V^{T}\) denotes the transpose of the matrix relating the predicted state to the measurement; and \(G^{-1}\) denotes the inverse of the covariance matrix of the measurement noise. \[m_{x}=m^{\prime}_{x}+\mathrm{K}m_{y} \tag{4}\]  
where \(m_{x}\) represents the corrected state of the system in the x direction  
\[L=(\mathrm{I}-\mathrm{K}\mathrm{V})L^{\prime} \tag{5}\]  
where L denotes the covariance matrix of the corrected state; I denotes the identity matrix; K denotes the Kalman gain; V denotes the matrix relating the predicted state to the measurement; \(L^{\prime}\) denotes the transpose of the covariance matrix of the predicted state; m represents the corrected state of the system after incorporating the measurements; and m\({}^{\prime}\) denotes the predicted state of the system before considering the measurements. In Equations (1)-(5), L represents the covariance of the matrix, and \((m_{x},m_{y})\) denotes the bounding box of the target vehicle. Deep SORT [40] helps to calculate the similarities among the motion features of vehicles in adjacent frames and apparent features, linking the vehicles of the same category, assigning unique IDs to different vehicles, and then tracking the objects throughout the videos. Figure 3 represents the Deep SORT algorithm-based vehicle tracking. Figure 3: Deep SORT algorithm-based vehicle tracking. The above method first initializes the state vector, covariance matrix, and the measurement matrix. Then, it predicts the next state based on the previous state by updating the covariance matrix. Finally, this algorithm computes the Kalman gain by estimating the states to track the vehicles.