YOLOv8 model-based additive manufacturing micro porosity defect detection and its dimension measurement
To address challenges related to low detection accuracy and poor dimensional measurement preci-sion of small defects on metal additive manufacturing surfaces,this study proposes a novel defect detection method based on the You Only Look Once(YOLO)v8 model.The Efficient Channel Attention(ECA)module is integrated into the detection head of the YOLOv8 framework,and the Complete Intersection Over Union(CIoU)loss function is replaced with the Wise Intersection Over Union(WIoU)loss function,effec-tively mitigating the impact of low-quality samples and enhancing detection performance.To overcome difficul-ties associated with training on high-resolution image datasets,which often lead to overfitting,local features containing target defects are cropped during the training phase to generate the training dataset.During infer-ence,high-resolution test images are divided into smaller sub-images using a sliding window approach for de-fect prediction.Detected defect sub-images are marked as regions of interest,and precise defect size measure-ment is achieved through edge detection techniques in computer vision.Experimental results demonstrate that the improved model achieves a detection accuracy of 94.3%,a recall rate of 93.4%,and an mAP50 of 97.3%,significantly outperforming traditional methods.Furthermore,the dimensional measurement accuracy for small defects reaches 40 μm,highlighting the effectiveness of the proposed approach.