In additive manufacturing, such as Selective Laser Melting (SLM), identifying fabrication defects poses a significant challenge. Existing identification algorithms often struggle to meet the precision requirements for defect detection. To accurately identify small-scale defects in SLM, this paper proposes a deep learning model based on the original YOLOv5 network architecture for enhanced defect identification. Specifically, we integrate a small target identification layer into the network to improve the recognition of minute anomalies like keyholes. Additionally, a similarity attention module (SimAM) is introduced to enhance the model’s sensitivity to channel and spatial features, facilitating the identification of dense target regions. Furthermore, the SPD-Conv module is employed to reduce information loss within the network and enhance the model’s identification rate. During the testing phase, a set of sample photos is randomly selected to evaluate the efficacy of the proposed model, utilizing training and test sets derived from a pre-existing defect database. The model’s performance in multi-category recognition is measured using the average accuracy metric. Test results demonstrate that the improved YOLOv5 model achieves a mean average precision (mAP) of 89.8%, surpassing the mAP of the original YOLOv5 network by 1.7% and outperforming other identification networks in terms of accuracy. Notably, the improved YOLOv5 model exhibits superior capability in identifying small-sized defects.