YOLO-Defender: A Lightweight CNN–Transformer Detector for Dike Crack Detection
Abstract
Surface cracks are critical indicators of deterioration in flood-control infrastructure, yet automated detection from inspection imagery remains challenging due to complex backgrounds, elongated geometries, and variations in apparent scale. This study aims to develop a lightweight detector for accurate dike crack detection while maintaining computational efficiency. A hybrid CNN–Transformer detector, termed YOLO-Defender, was built on YOLOv8n. The proposed framework incorporates a C2F-FTB block in the backbone for local–global feature representation, a BiFF-PAN neck for enhanced multi-scale feature fusion, and coordinate attention for improved spatial feature localization. The model was evaluated on an in-house dike crack dataset containing 1217 images collected from flood-defense structures and related crack imaging scenarios using a unified training and testing protocol. YOLO-Defender achieved 89.6% mAP@0.5 and 69.2% mAP@0.5:0.95, improving YOLOv8n by 3.0 and 5.1 percentage points, respectively. Compared with YOLOv8n, the proposed model reduced parameters and GFLOPs by 41.2% and 18.5%, respectively, while achieving an inference speed of 153 FPS on a desktop GPU. The results indicate that task-oriented architectural design can improve crack detection accuracy and localization performance while preserving lightweight characteristics. These findings support efficient screening of hydraulic infrastructure inspection imagery.