RÉSUMÉ
ObjectiveTo realize the automatic recognition of the slicing angles of Fritillariae Thunbergii Bulbus (FTB) based on the improved YOLOv7-tiny algorithm. MethodFirstly, a diverse dataset of FTB images, totaling 16 000 pictures, with various angles was constructed. Furthermore, improvements were made to YOLOv7-tiny by replacing standard convolutions with ghost convolution (GhostConv), incorporating the coordinate attention (CA) mechanism as a preferred addition, substituting some activation functions with HardSwish function for decreasing the floating point operations. Additionally, a penalty term for angle recognition error was integrated into the loss function, and modifications were made to the non-maximum suppression (NMS) strategy to address cases where multiple detection results were associated with the same target. In order to verify the effectiveness of different improvement points on the optimization of the algorithm model, ablation experiments were carried out on all the improvement points, and the effectiveness of the improvement points was proved by comparing the prediction results before and after the addition of a certain improvement point on the basis of the original model or the model with the addition of an improvement point that has been verified to be effective, in order to evaluate the improvement of the indexes. ResultThe number of parameters required for the improved slicing angle recognition algorithm of FTB was about 55.4% of the original algorithm, and the amount of computation was about 59.4% of the original algorithm. The mAP@0.5[mean average precision at an intersection over union(IoU) of 0.5] increased by 12.2%, the mean absolute error(MAE) of the recognized angle was 5.02°, representing a reduction of 4.58° compared to the original algorithm. In the experimental environment of this paper, the average recognition time per image was as low as 8.7 ms, significantly faster than the average human reaction time. ConclusionThis study, by utilizing the improved YOLOv7-tiny algorithm, achieves effective slicing angle recognition of FTB with high accuracy and more lightweight, which provides a novel approach for stable and precise automated slicing of FTB, thereby providing valuable insights into the automation of processing other traditional Chinese medicines.