# Highly Accurate Deep Learning Models for Estimating Traffic Characteristics from Video Data
## 4 Results Analysis  
### Speed Detection Accuracy  
Due to the dearth of publicly available labelled traffic cameras as the ground truth source for speed evaluation, a custom dataset with traffic footage labelled by LiDAR was established for model evaluation in this study. The validation dataset is composed of a total of two hours of videos with 15 min for each freeway section (with a coverage of 200 m). The traffic scenes are displayed as follows in Figure 5.  
Figure 4: Virtual box and shadow area movements when a vehicle passes.  
For an output of length M, a simple mean square error of the loss function \(J\) was incorporated for model evaluation as follows:  
\[J\big{(}\theta_{output}\big{)}=\frac{1}{M}{\sum_{i}}^{M}\Big{(}\theta_{output,i} -\theta_{groundtruth,i}\Big{)}^{2} \tag{16}\]  
False negatives during the object detection phase are treated as output speed 0. For ease of calculation and generalizability, the vehicle speed \(\theta\) denotes the speed mean over a frame sequence of \(S\) instead of individual frames.  
The dedicated validation dataset comprises footage from varying traffic camera heights and angles to simulate a real-world scenario. Dataset footage is categorised into groups  
Figure 5: Representative scenario used for speed detection (straight lines denote detection region).  
by the respective camera view (e.g., parallel, diagonal, or perpendicular in terms of the camera's view of the road's direction). Camera installations with a view direction perpendicular to the road, while rare on existing highways, were selected to evaluate the influence of perspective view distance on the model's accuracy. Losses resulting from the detection in different distance ranges (on the ground plane space) are separated to emphasise the effect on accuracy from the detection distance.  
The detection accuracy is 1 minus the percentage of errors which is the proportion of difference between actual speed and estimated speed. This is less significant in the footage with a perpendicular view, as the forward direction of a vehicle is not affected by the projection transformation, thus retaining precision.  
Another deficiency is the constant fluctuation of speed for vehicles near the vanishing point in a parallel view. Theoretically, the magnitude of fluctuation is exponentially larger for vehicles in greater proximity to the vanishing point, as each pixel translates to a larger span in world space. The fluctuation can be reasonably suppressed with the proportional integral derivative (PID) control as the kernel function \(\sigma\) as mentioned previously and contributes to tuning down sporadic spikes of false acceleration/deceleration [39]. PID function is a computer technique that was first introduced in industrial processing control for noise reduction and signal filtering.  
Although incorporating a filtering kernel yields a significant reduction in fluctuating noise, the suppression weakens after about 50 m on footage obtained from standardized traffic cameras with an elevation of 12 m. Note that the distance as shown in Table 2 and Figure 5 is measured as the distance on the horizontal plane (the elevation of the camera is not taken into account).  
As noted in Table 2, the estimated speed is quite precise within 50 m in the daytime with respect to the frontal view. For nighttime, the estimation is badly influenced by miss detection, as the available sight distance is short.