Container structural integrity is vital to global trade safety and operational efficiency; however, manual damage inspection is time-consuming and error-prone, particularly for minor defects in complex port environments. Although machine vision has provided promising solutions, existing methods remain limited by difficulties in multi-scale damage detection under cluttered backgrounds, high computational complexity, and frequent missed detections of small targets. To overcome these challenges, a novel two-stage detection framework is proposed in this article. In the first stage, a Lightweight U-Net integrated with a Convolutional Block Attention Module (CBAM) is employed to achieve precise container surface segmentation and effective background stripping. By incorporating depthwise separable convolutions in shallow layers and CBAM-enhanced skip connections, the proposed model reduces parameters by 28. 4% (to 20. 21M) while maintaining high segmentation accuracy (99. 03% mIoU) and real-time inference speed (48 FPS). In the second stage, a Vision Transformer (ViT) equipped with an adaptive dual-threshold mechanism is used to classify the segmented container surface as damaged or undamaged. Leveraging ViT’s global attention capability, classification sensitivity is dynamically adjusted through a confidence threshold (ₛ) in conjunction with an optimized classification threshold (c), effectively reducing false positives. Experimental results demonstrate an F1-score of 94. 7%, a false positive rate of 5. 0%, and a manual review rate of only 10. 0%, significantly outperforming You Only Look Once (YOLO) -based detectors, conventional convolutional neural networks (CNNs), and standalone ViT models. Overall, the proposed framework achieves a favorable balance between accuracy, efficiency, and deployability on edge devices, providing a robust “machine-dominant, human-assisted” solution for automated container inspection in port environments.
Li et al. (Mon,) studied this question.