F1 score curve diagram.
With the increasing application of aluminum alloys in the industrial field, the defect of aluminum alloys significantly impacts the structural integrity and safety of products. However, state-of-the-art material defect detection methods have low detection accuracy and inaccurate defect target frame problems. Therefore, an enhanced YOLOv8-ALGP (aluminum, Ghost, P2) defect detection and classification method for 13 defects is proposed in this paper. Firstly, based on the AliCloud Tianchi dataset, 3 defects are added and an enhancement strategy is implemented to increase the diversity of the training dataset, which improves the generalization ability of the model. Secondly, an ALGC3 (aluminum, Ghost, Concentrated-Comprehensive Convolution Block (C3)) module is introduced to optimize the fusion of Ghost convolution and residual connectivity, resulting in a more lightweight model. Finally, the backbone network structure is reconstructed. Fine-grained adjustments and improvements are made to enhance neck network layers and the feature extraction capability. Defect features are extracted and analyzed more efficiently, and the network model better identifies defects such as jet, camouflage, etc. The average detection rate of all defects in the data set is improved. As a result, the average detection rate of all defects in the dataset is improved. Experimental results show that the proposed method performs effectively in target detection and classification. The number of model parameters is reduced from more than 300,000 to 160,000, significantly reducing the complexity of the model. In addition, the average detection accuracy is improved from 64.5% to 71.3% compared to the YOLOv8. In addition, the detection accuracies of effacement and jet defects, particularly, are improved from 21.6% and 38.5% to 32.2% and 60%, respectively. It shows that the proposed method can effectively identify the surface defects of aluminum alloys, which improves product performance in the aluminum industry.