# Strans-YOLOX: Fusing Swin Transformer and YOLOX for Automatic Payement Crack Detection
###### Abstract  
Automatic pavement crack detection is crucial for reducing road maintenance costs and ensuring transportation safety. Although convolutional neural networks (CNNs) have been widely used in automatic pavement crack detection, they cannot adequately model the long-range dependencies between pixels and easily lose edge detail information in complex scenes. Moreover, irregular crack shapes also make the detection task challenging. To address these issues, an automatic pavement crack detection architecture named STrans-YOLOX is proposed. Specifically, the architecture first exploits the CNN backbone to extract feature information, preserving the local modeling ability of the CNN. Then, Swin Transformer is introduced to enhance the long-range dependencies through a self-attention mechanism by supplying each pixel with global features. A new global attention guidance module (GAGM) is used to ensure effective information propagation in the feature pyramid network (FPN) by using high-level semantic information to guide the low-level spatial information, thereby enhancing the multi-class and multi-scale features of cracks. During the post-processing stage, we utilize \(\alpha\)-IoU-NMS to achieve the accurate suppression of the detection boxes in the case of occlusion and overlapping objects by introducing an adjustable power parameter. The experiments demonstrate that the proposed STrans-YOLOX achieves 63.37% mAP and surpasses the state-of-the-art models on the challenging pavement crack dataset. pavement crack detection; object detection; Swin Transformer; YOLOX; global guidance attention; multi-scale feature fusion; NMS; complex scenes +
Footnote †: journal: Medical Image Analysis  
which leads to a reduction in segmentation accuracy. In addition, some traditional machine learning methods have also been used for the pavement crack detection task, such as the support vector machine (SVM) and random forest (RF). For example, [PERSON] et al. [3] proposed the CrackForest framework by introducing a random structured forest for integrating different features into a high-performance crack detector, which can effectively detect pavement cracks with uneven edges and complicated topological structures. However, methods based on traditional machine learning are not universal and rely on hand-crafted features. Moreover, complex pavement conditions, variable illumination and the feature inhomogeneity of cracks make the pavement crack detection task very challenging. Recently, deep learning has achieved huge success in many computer vision tasks. By establishing a hierarchical structure from low-level features to high-level features, it can automatically learn and construct the complete features of objects. Deep learning, especially a deep convolutional neural network (CNN), has been applied in pavement crack detection [4; 5], and it is superior to traditional image processing and machine learning. Therefore, employing a deep CNN for pavement crack detection is the general trend within industry. Nevertheless, there are still some issues concerning existing CNN-based crack detection methods. First, a CNN cannot adequately model the long-range dependencies due to its inherent locality [6], especially when uneven illumination results in low contrast between cracks and background and when there is background noise (leaves, oil stains, water stains, etc.). Moreover, cracks are a kind of strip defect with strong boundary information, and the long-range dependencies are crucial to capturing the boundary details. In addition, cracks are characterized by a large variety of shapes and scales. Objects of different scales need to be recognized on the corresponding feature layers, that is, small-sized objects are recognized on low-level feature maps and large-sized objects are recognized on high-level feature maps.