Abstract:Chinese herbal medicine decoction pieces refer to drugs that can be directly used in cinical practice or formulation production after processing.In response to the problems of the wide variety,different shapes,and difficult identification of Chinese herbal medicine decoction pieces,this article proposes an improved Res2Net and attention mechanism Chinese herbal medicine decoction piece recognition model BIM-Res2Net50-IECA.Firstly,a bidirectional fusion strategy is introduced on the basis of Res2Net to promote effective interaction between features of different scales and obtain more refined and rich feature information.Secondly,using max pooling to improve the ECA attention mechanism,while enhancing the global perspective and salient features,highlighting the important feature regions of traditional Chinese medicine decoction pieces.Finally,ajoint loss function is constructed by combining Softmax Loss and Center Loss,which effectively adjusts the intra-and inter class distances and improves the accuracy of classification. Experiments have shown that the baseline model proposed in this paper can effectively extract multi-scale features.BIM- Res2Net50-IECA achieved accuracy,precision,recall,and F1-Score of 94.74%,94.27%,94.83%,and 94.55%, respectively.Compared with the advanced Tansformer classification model,it has lower computational complexity and higher accuracy,providing strong support for intelligent recognition of traditional Chinese medicine decoction pieces.