In X-ray security inspection imagery, hazardous object detection is challenged by severe object overlap/occlusion, ambiguous boundaries of small objects, and complex texture representations caused by material diversity. Although YOLOv8-seg provides real-time instance segmentation capability, it still has clear limitations in this application scenario. Specifically, the original SPPF module has limited ability to model long-range spatial dependencies, making it difficult to accurately separate boundaries of densely overlapped objects, while the C2f module is insufficient for multi-scale feature parsing of hazardous items with diverse sizes and materials and introduces feature redundancy, which degrades segmentation accuracy in occluded scenes. To address these issues, this paper proposes an improved YOLOv8-seg framework for X-ray hazardous object detection, termed LM-YOLOv8. For feature enhancement, an SPPF-LSKA module is constructed by integrating large-kernel separable attention with dynamic receptive-field adjustment, thereby improving global contextual modeling and alleviating boundary ambiguity. For multi-scale feature fusion, a C2f-MSC module is designed by combining multi-branch dilated convolutions with the C2f structure to enhance complex contour parsing and cross-scale feature interaction. Experiments on the PIDray dataset show that the proposed method achieves 84.8% mAP50 in instance segmentation, representing an improvement of approximately 4.0 percentage points over the baseline YOLOv8-seg. In addition, the method demonstrates stronger robustness on challenging hard/hidden subsets, validating its effectiveness for X-ray security inspection hazardous object detection.
Wang et al. (Sat,) studied this question.