Defect Detection in the DR Images of Aluminum and Magnesium Alloy Castings Based on the Improved YOLOv8 Algorithm - Mingfei CHEN; Shuai TIAN (CT Lilun yu yingyong yanjiu)
Existing algorithms can miss detecting small target defects owing to the complex background structure and noise in the DR images of aluminum and magnesium alloy castings. Therefore, this study proposes a defect detection method for the DR images of aluminum and magnesium alloy castings based on the improved YOLOv8 algorithm. First, a method integrating multi-scale enhancement and contrast-limited adaptive histogram equalization is proposed to effectively solve the problems of noise, low brightness,and insufficient information in the DR images of aluminum and magnesium alloy castings. Second, the YOLOv8 network structure is improved, and the context anchor attention (CAA) mechanism is introduced to pay more attention to key defect features; the cross-scale feature fusion module (CCFM) is introduced to enhance the expression ability of multi-scale features; the detection head is improved to enhance the detection ability of small targets. Experimental results showed that the precision, recall, and mean average precision (mAP) of the improved YOLOv8 algorithm on the defect dataset reached 92.7%, 98.5%, and 92.4%, respectively, and the detection speed was 138 FPS that met the real-time requirements of intelligent production lines for defect detection in the DR images of aluminum and magnesium alloy castings.