Improved defect detection algorithm of TCM decoction pieces based on YOLOv5
To achieve efficient sorting of Chinese herbal medicine pieces,and to address the issue of some defect fea-tures being similar and difficult to distinguish during the screening process,this paper proposes a Chinese herbal medicine piece defect detection algorithm based on an improved YOLOv5.Firstly,the Faster Net network structure is introduced in the Backbone,replacing the original C3 structure,to reduce the model parameter count and improve detection efficiency.Secondly,a SimAM three-dimensional attention module is added to better extract target features.Lastly,the Sim OTA label matching mechanism is introduced to increase the training speed of the model while also enhancing detection accuracy.Testing on the Astragalus herbal pieces dataset,the final results show that the improved network model achieves a mean Average Precision of 87.53%,which is a 1.78%improvement over the original model,indicating a stronger capability in recognizing various defects in Chinese herbal medicine pieces.