# An Improved YOLOX Model and Domain Transfer Strategy for Nighttime Pedestrian and Vehicle Detection
## 5 Experimental Comparison and Discussion
### Analysis
#### 5.3.4 Comparison of Different Testing Methods  
To further illustrate the effectiveness of the proposed method, the detection performance is compared with YOLOv3, YOLOv4, and YOLOv5 in the one-stage detection method and Faster R-CNN and Cascade R-CNN in the two-stage detection method using the same experimental configuration in the nighttime vehicle/pedestrian dataset, and the results are shown in Table 4. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Training Method**} & \multicolumn{2}{c}{**AP**} & \multirow{2}{*}{**mAP**} & \multirow{2}{*}{**F1**} & \multirow{2}{*}{**Recall**} & \multirow{2}{*}{**Precision**} & \multicolumn{2}{c}{**Inference**} & \multicolumn{1}{c}{**Model**} \\ \cline{2-2} \cline{6-9}  & **Person** & & & & & & **Time (ms)** & **Size (MB)** \\ \hline YOLOX (Baseline) & 0.768 & 0.762 & 0.765 & 0.736 & 0.685 & 0.796 & 11.2 & 17.2 \\ +Lightweighting (lower number of channels) & 0.760 & 0.756 & 0.758 & 0.729 & 0.678 & 0.788 & **11.0** & **13.3** \\ +Lightweighting (CSP) & 0.763 & 0.762 & 0.763 & 0.736 & 0.687 & 0.793 & 12.8 & 13.8 \\ +reparameterization and lightweight & 0.770 & 0.761 & 0.766 & 0.740 & 0.662 & **0.839** & 12.6 & 13.5 \\ +Attention Mechanism & 0.781 & 0.769 & 0.775 & 0.743 & 0.700 & 0.792 & 20.3 & 13.8 \\ Module (3 levels) & 0.789 & 0.796 & 0.793 & 0.752 & 0.700 & 0.813 & 23.0 & 15.8 \\ Improvement & 0.795 & 0.798 & 0.797 & 0.753 & **0.724** & 0.786 & 23.2 & 15.8 \\ +CIoU Loss & **0.801** & **0.801** & **0.801** & **0.761** & 0.718 & 0.809 & 23.1 & 15.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Improved YOLOX algorithm for ablation experiments. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**P2**} & \multirow{2}{*}{**P3**} & \multirow{2}{*}{**P4**} & \multirow{2}{*}{**P5**} & \multicolumn{3}{c}{**3 Layer**} & \multirow{2}{*}{**1 Layer**} \\ \cline{5-6}  & & & & & **mAP** & & **Inference Time (ms)** & **mAP** & **Inference Time (ms)** \\ \hline
1 & & & & \(\sqrt{\text{\tiny{}}}\) & 0.788 & **17.2** & 0.780 & **16.1** \\
2 & & & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & 0.791 & 21.6 & 0.789 & 17.2 \\
3 & & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & **0.801** & 23.1 & **0.796** & 17.8 \\
4 & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & \(\sqrt{\text{\tiny{}}}\) & 0.782 & 25.1 & 0.782 & 18.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of CA module location and number of layers. From Table 4, it can be seen that the improved algorithm proposed in this paper has the best performance indexes in terms of mAP, F1, and Recall value compared with the YOLO series algorithm and the two-stage algorithm, which are 79.6%, 75.8%, and 72.3%, respectively. Meanwhile, the algorithm in this paper can meet the requirements of real-time detection in terms of inference speed, and the model size is only 15.6 MB, which can be deployed in low-performance storage devices. Although compared with YOLOv5, this algorithm does not have an advantage in inference speed and model size, the average detection accuracy mAP is 5.8% higher and the recall Recall is 8.7% higher. As a result, night object detection is improved, and the model size and inference time can be further reduced by model pruning and quantization operations. Therefore, in practical applications, the algorithm in this paper is more advantageous. In addition, to illustrate the effectiveness of the data domain transfer training strategy more clearly, a comparative analysis was performed with the improved algorithm without the data domain transfer method, and the comparison results are shown in Table 4 above. From the results, it can be seen that performance metrics such as mAP, F1, Recall, and Precision values are further improved after the improved algorithm was trained by the data domain transfer strategy, and the mAP values are better compared to adding additional daytime training datasets directly for mixed training.