Search for a command to run...
To meet the requirement of real-time bridge crack detection, this paper proposes a lightweight detection model based on YOLOv7-tiny. First, an edge-preserved image enhancement method is proposed. It effectively enhances the image contrast and preserves the structural features of crack edges. This provides a high-quality data foundation for the detection network. Second, a LWCSP module is introduced. This module integrates hybrid convolution and shuffle operations. It reduces the model’s parameter count and computation. Simultaneously, it maintains strong feature representation capability. A good balance between detection performance and efficiency is achieved. Finally, an improved SWise-IoU is proposed to optimize the bounding box regression in YOLOv7-tiny. This method dynamically evaluates sample quality. It enables differentiated gradient adjustment for samples of different qualities. This promotes sufficient learning of sample features by the model, thereby improving detection accuracy. Experimental results show that the proposed model delivers strong performance on a public bridge crack dataset. Compared to the baseline, the mAP@0.5 is 12.1 higher, and model size, parameter count, and FLOPs are reduced by 7.3%, 8.03%, and 10%, respectively. The final model size is only 11.4 MB, and mAP@0.5 is 86.1%, suitable for a real-time crack detection task.