Rural pavement crack detection algorithm based on improved Swin-Transformer
Cracks are a primary form of rural pavement distress,and their detection is often hindered by interference factors such as road shadows,weeds,and soil,complicating automated detection based on road images.To address this issue,this study proposes the Swin-Transformer Rural Road Crack Detection(S-TRCD)model,which leverages the Swin-Transformer backbone network.To mitigate the reduced recognition accuracy caused by surrounding interference during feature extraction,an adaptive hybrid attention mechanism module,CAS(Channel and Spatial),is designed.This module adjusts the crack weights in both spatial and channel dimensions,enhancing the model's resistance to interference.To address the challenge of identifying cracks of varying sizes within the same image,a multi-scale object detection head with an attention mechanism,AHead(Attention Head),is developed.This detection head adaptively adjusts the network's receptive field,enabling effective multi-scale crack detection.A rural pavement distress benchmark dataset,LNTU_RDD_NC,is created to evaluate the performance of the S-TRCD model.The study also trains and compares the S-TRCD model with commonly used detection models in the field,including improved YOLOv5,Faster R-CNN,and YOLOv8.Experimental results demonstrate that the S-TRCD model achieves mean average precision 4.06%,12.12%,and 2.84%higher than the improved YOLOv5,Faster R-CNN,and YOLOv8 models,respectively,highlighting its superior detection performance for rural pavement crack detection.