Casting Defect Detection and Segmentation in X-ray Images Based on SAHI and YOLO11-seg Algorithms
摘要
Defects in large and complex castings are characterized by small size, global dispersion with local clustering, large intra-class variations and small inter-class differences, which pose significant challenges for automatic defect detection. In this paper, casting defect detection and segmentation in X-ray images was conducted based on the SAHI (Slicing Aided Hyper Inference) and YOLO11-seg algorithms. After preprocessing of the original images, such as denoising and contrast enhancement, overlapping slicing was performed to construct a patch dataset, thereby increasing the relative scale of defects. To enhance the ability to jointly perceive the semantic and spatial information of defects, a training strategy combining pre-training on full images and fine-tuning on overlapping patches was adopted in the YOLO11-seg model. Then, the model was embedded into the SAHI framework to achieve end-to-end detection and segmentation of casting defects in high-resolution X-ray images. The results demonstrate that compared with the method of training directly on preprocessed full images, the proposed method improves the precision, recall, and mAP by 12.3, 25.7 and 29.1 percentage points for bounding boxes and 22.2, 25.1 and 25.9 percentage points for masks, respectively. Mean while, the overfitting problem of the YOLO11-seg model is alleviated. The excellent performance of the proposed method is then proved on automatic defect detection and segmentation of large and complex castings.