# Real-Time, Deep Learning Based Wrong Direction Detection
## 4 Experiments and Results
### Wrong-Direction Detection Testing  
To justify the efficiency of our work, we provided a qualitative experiment. Testing wrong-way detection is based more from the structure of the related facts than from the testing of the existing assumption. Therefore, we tested our implemented \"entry-exit\" algorithm for wrong-direction detection on two types of data: real data and simulated data. Due to the difficulty in getting actual wrong way driving events, we simulated them by intentionally driving a car the wrong way. For the first simulation case, we checked daytime wrong-direction detection. As illustrated in Figure 7, a car going the wrong way enters from area C and is tracked until it reaches area A, which in this case is where it exits. As soon as it reaches area C, image and information about the car were sent to the monitoring center using the File Transfer Protocol (FTP) and Transmission Control Protocol (TCP). The program detects moving vehicles from an 807 \(\times\) 646 video frame at 30 fps.  
Due to safety reasons, Korean road traffic authority (KoROAD) did not allow us to simulate driving during nighttime. Therefore, for the second and third simulation cases we inverted daytime and nighttime videos as shown in Figure 8 to check true-positive results. Results obtained from the first simulation case can be seen in Table 2 where 'positive direction' is the number of cars moving in the correct direction, and 'negative direction' is the number of wrong-way driving cases. For case 1 we considered the case when the car was driven wrong-way in the daytime, where N is the total number of unique cars. For case 2 we considered a horizontally flipped video from case 1 and finally for the third case we took a flipped nighttime video to check the accuracy during nighttime. The reason we flipped the video frame is that [PERSON] et al. [8] used the image flipping method to check the accuracy of their system. From Table 2 we can measure the performance of our wrong-direction detection system (Table 3). Visual results are presented in Figure 8.  
Another evaluation we conducted determined false-positive results. The system was tested for 24 h to identify the number of false-positives. Our program counted 5552 cars passing by the camera within 24 h, identifying only one false-positive that occurred owing to the car's illumination at night (Table 4). Visual results on determining false-positive cases can be seen on Figure 9.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**N = 5552** & **Predicted ’NO’** & **Predicted ’YES’** \\ \hline Actual ’NO’ & 5551 & 1 \\ Actual ’YES’ & 0 & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Confusion matrix for real-world cases.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Case 1: N = 114** & **Predicted Positive Direction** & **Predicted Negative Direction** \\ \hline Positive direction & 110 & 0 \\ Negative direction & 0 & 4 \\ Case 2: N = 114 & & \\ Positive direction & 0 & 0 \\ Negative direction & 12 & 102 \\ Case 3: N = 36 & & \\ Positive direction & 0 & 0 \\ Negative direction & 5 & 31 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Confusion matrix for three simulation cases (quantity of cars).  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Cases** & **Accuracy** & **Precision** & **Recall** & **F1 Score** \\ \hline Case 1: Daytime & 100.00 & 100.00 & 100.00 & 100.00 \\ Case 2: Daytime (flipped) & 89.83 & 100.00 & 89.00 & 94.44 \\ Case 3: Nighttime (flipped) & 86.11 & 100.00 & 86.00 & 92.53 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Performance measurement in (%).  
Figure 8: Wrong-direction detection for the three simulation cases.  
Figure 9: Real-time detection example during both daytime and nighttime.