# Strans-YOLOX: Fusing Swin Transformer and YOLOX for Automatic Payement Crack Detection
###### Abstract
Moreover, for the same object, low-level feature maps with high resolution can generate detailed information such as boundaries and textures, while high-level feature maps with low resolution can capture advanced semantic information and so are suitable for object classification. Therefore, the effective fusion of different levels of feature maps helps improve the detection accuracy of multi-class and multi-scale cracks. Most methods mainly rely on a feature pyramid network (FPN) [7; 8] to realize the fusion of feature maps with different scales. However, the inputs of the FPN are only achieved through simple upsampling and the concatenation of feature maps without considering the adaptability between different scales of feature maps and cracks. These issues make the performance of CNN-based models decline. Recently, transformers [9] have been applied in the field of computer vision with increasing successes. A transformer makes up for the deficiency of a CNN, and its unique self-attention mechanism can learn the long-range dependencies between image pixels and capture global information. Particularly for the objects that vary greatly in terms of their textures, shapes and scales, a transformer usually produces better performance. Based on the transformer concept, [PERSON] et al. [10] designed Swin Transformer, which uses a hierarchical architecture resembling a CNN to build a hierarchical transformer with significant computational efficiency. Swin Transformer achieves state-of-the-art performance in computer vision tasks. In object detection tasks, the YOLO series [11; 12; 13; 14] plays a vital role in single-stage detectors. In particular, the latest YOLOX [15], with its quick detection speed and high detection accuracy, has strong recognition ability in vision tasks. Motivated by the above analysis, an automatic pavement crack detection architecture is proposed and named STrans-YOLOX. It fuses Swin Transformer and YOLOX to address existing challenges. The network adds the strength of a self-attention mechanism to learn the long-range dependencies based on the efficient local modeling of a CNN. During the feature extraction stage, the last CSPLayer module in the backbone is replaced by the Swin Transformer block to compensate for the insufficient long-range dependencies of the convolution operations and to extract rich feature information from crack images. In addition, some CSPLayermodules in the FPN are replaced with Swin Transformer blocks to obtain the self-attention of multi-scale features to preserve the edge detail information. It can also explore the potential of Swin Transformer to integrate multi-scale features in the FPN. Then, a global attention guidance module (GAGM) is designed to change the original input way of different scales of feature maps and enhance the feature fusion ability of multi-class and multi-scale cracks. By introducing the GAGM between feature maps of adjacent scales, the global context information of high-level feature maps is obtained, and the advanced semantic information is used to weight the low-level feature maps so as to guide the effective multi-scale feature fusion between low-level feature information and high-level feature information. Thus, it can overcome the semantic and scale inconsistency when multi-class and multi-scale crack features are input into the FPN. In addition, to alleviate the phenomenon of missing detection caused by occlusion and overlapping objects, we adopt the \(\alpha\)-IoU-NMS algorithm during the post-processing stage. By introducing an adjustable power parameter to meet the different levels of suppression accuracy of the detection boxes, \(\alpha\)-IoU-NMS can suppress the redundant boxes more accurately and reduce the missing detection of occlusion and overlapping objects. Compared with the original YOLOX, our proposed STrans-YOLOX further improves the detection accuracy of pavement cracks with acceptable detection speed. To sum up, our major contributions are as listed below:  
1.