# Strans-YOLOX: Fusing Swin Transformer and YOLOX for Automatic Payement Crack Detection
## 4 Experiments and Results
### Experimental Results and Analysis  
(1) Comparison of the Results with the State-of-the-Art Models  
To assess the effectiveness of STrans-YOLOX, we compared it with other state-of-the-art object models on the same test set, including SSD [33], CenterNet [34], RetinaNet [35], YOLOv3 [13], YOLOv4 [14], and YOLOv5. The specific detection results are shown in Table 2. In terms of the mAP, STrans-YOLOX achieves 63.73%, which is superior to other models. Our model achieves a significant improvement in the AP values of all three classes, and the value of mAP is improved by 3.17% compared with the original YOLOX. STrans-YOLOX strengthens the extraction ability of crack features in complex scenes and further enhances the detection performance for multi-class and multi-scale cracks, while  
Figure 6: The training curve of the loss function. also dealing with occlusion objects more appropriately. With respect to the detection speed, although the generated FPS of STrans-YOLOX is reduced compared to the original YOLOX, it can reach 26.59, which is acceptable in terms of meeting the requirement of real-time detection. Therefore, when comprehensively compared with the current mainstream detection models, STrans-YOLOX is effective in detecting pavement cracks in the challenging dataset. Figure 7 is a comparison of the F1-Score curves of YOLOX and STrans-YOLOX of three classes of cracks. The F1-Score, also known as the balanced F1-Score, is defined as the harmonic average of the Precision and Recall. The F1-Score takes values ranging from 0 to 1, with 1 representing the best output of the model and 0 representing the worst output of the model. It can be seen from the graph that STrans-YOLOX greatly improves the F1-Score in all three classes compared with the original YOLOX. (2) Ablation Study  
To verify the effectiveness of our proposed model, we conduct ablation experiments to analyze the importance of each module, including the Swin Transformer block, GAGM and \(\alpha\)-IoU-NMS. The impact of each module is listed in Table 3. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multicolumn{4}{c}{**Accuracy (\%)**} & \multirow{2}{*}{**FPS**} \\ \cline{2-2} \cline{5-6}  & **AP (D00)** & **AP (D10)** & **AP (D20)** & **mAP** & \\ \hline SSD & 50.37 & 30.14 & 68.57 & 49.70 & 27.65 \\ CenterNet & 55.56 & 44.92 & 65.34 & 55.28 & 37.32 \\ RetinaNet & 58.30 & 23.61 & 73.33 & 51.75 & 21.82 \\ YOLOv3 & 55.40 & 44.88 & 70.47 & 56.91 & 26.17 \\ YOLOv4 & 54.30 & 46.08 & 70.61 & 57.00 & 19.99 \\ YOLOv5-M & 57.17 & 38.51 & 65.33 & 53.67 & 39.43 \\ YOLOX-M & 59.92 & 50.98 & 70.18 & 60.36 & 39.01 \\ STrans-YOLOX & 62.11 & 55.78 & 73.30 & 63.73 & 26.59 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison results of different models on the pavement crack test set. Figure 7: F1-Score curves of YOLOX and STrans-YOLOX of three classes of cracks. (a) Effect of Swin Transformer Blocks  
After using the Swin Transformer blocks to replace some CSPLayer modules, the model mAP is increased by 1.67%, and the AP values of the transverse cracks and alligator cracks are greatly increased. The experiment demonstrates that the method combining Swin Transformer and a CNN has better performance than the pure CNN-based network. This is mainly because Swin Transformer can effectively improve the feature extraction ability in complex scenes by introducing long-range dependencies, and it is able to keep detailed information concerning input images. (b) Effect of GAGM  
After the GAGM modules are added into the FPN, the mAP of the model is improved by 1.2%. The GAGM has a good detection effect, especially for longitudinal cracks and transverse cracks, and it plays a role in the detection of multi-class and multi-scale objects. (c) Effect of \(\alpha\)-IoU-NMS  
By employing the \(\alpha\)-IoU-NMS algorithm, STrans-YOLOX increases the mAP by 0.5% with no increase in the parameter number.