Abstract:
Reliable cotter-pin state identification is essential to prevent costly connection failures in industrial steel structures. Although unmanned aerial vehicle (UAV) inspection is safer and more efficient than traditional close-range manual inspection, automated visual analysis is hindered by extremely small targets, slender tails, common occlusion, and complex backgrounds. Object detection alone cannot determine whether two tail branches are opened to a fully compliant angle. To address these limitations, this paper proposes a novel cascaded computer-vision method integrating cotter-pin localization, pixel-level segmentation, and geometry-based state assessment. In the localization stage, a shallow P2(Pyramid level 2) detection branch, efficient multi-scale attention (EMA), the ADown downsampling module, and a bidirectional feature pyramid network (BiFPN) are integrated into YOLOv12(You only look once version 12). These components form the P2–EMA–ADown–BiFPN (PEAB) network, which preserves fine spatial information and improves cross-scale feature fusion to precisely extract regions of interest (ROIs) containing cotter-pin assemblies. In the segmentation stage, DeepLabv3+ is combined with an optimized receptive-field-reconstructed MobileNetV3 lightweight backbone. Coordinate attention is introduced into the multiscale context module and shallow feature path to retain positional information during feature aggregation. A composite loss function combining cross-entropy, Dice, and boundary losses, termed cross-entropy–dice–boundary loss, is designed to alleviate foreground-background imbalance and improve the continuity of slender tail boundaries. The resulting segmentation masks are converted into interpretable geometric measurements. The foreground pixel count and effective connected-component area are used to identify missing cotter pins or invalid masks. For valid masks, the largest contour is extracted, the tail branching structure is identified, and the opening angle between the two branches is calculated to distinguish normal, missing, and nonstandardized installation states. A dataset comprising 3,000 original UAV inspection images and 6,420 cotter-pin ROI samples is presented for model development and evaluation. The proposed PEAB detector achieves a mean average precision (mAP) of 94.30% at an intersection-over-union threshold of 0.5 (mAP@0.5) and mAP@0.5:0.95 of 54.28%. Factorial ablation experiments that examine the individual and interaction effects of the P2 branch, EMA, ADown, and BiFPN are presented. Furthermore, YOLO-series and representative non-YOLO detectors are comparatively analyzed to evaluate the method across different detection architectures. Compared with the original DeepLabv3+, the improved segmentation model increases the mean intersection over union and mean F1 score by 4.85 and 3.90 percentage points, respectively. The segmentation network contains 2.51 million parameters and requires 5.37 billion floating-point operations. Under the reported NVIDIA RTX
3090 environment, the localization and segmentation stages process 58.32 frame·s
–1 and 84.85 s
–1, respectively. On the 642-sample state-assessment test set, the geometry-based procedure achieves a micro-average F1 score of 96.11%. An independent external validation set comprising 360 images and 636 annotated ROIs collected from five construction sites yield an ROI localization rate of 97.17%, a conditional state-classification accuracy of 97.25% among successfully localized ROIs, and an abnormal-state recall of 96.55%. These results show that multiscale small-object localization, boundary-aware lightweight segmentation, and explicit geometric reasoning can provide accurate and interpretable cotter-pin state assessment in complex UAV inspection scenes. The proposed method provides a practical basis for the visual inspection of steel-structure joints, although its performance on embedded airborne hardware requires further validation.