Abstract
Individual cow identification is a prerequisite for automatically monitoring behavior patterns, health status, and growth data of each cow, and can provide the assistance in selecting excellent cow individuals for breeding. Despite high recognition accuracy, traditional implantable electronic devices such as RFID (i.e., Radio Frequency Identification) can cause some degree of harm or stress reactions to cows. Image-based methods are widely used due to their non-invasive advantages, but these methods have poor adaptability to different environments and target size, and low detection accuracy in complex scenes. To solve these issues, this study designs a Dy_Conv (i.e., dynamic convolution) module and innovatively constructs a Dynamic_Bottleneck module based on the Dy_Conv and S2Attention (Sparse-shift Attention) mechanism. On this basis, we replaces the first and fourth bottleneck layers of Resnet50 with the Dynamic_Bottleneck to achieve accurate extraction of local features and global information of cows. Furthermore, the QAConv (i.e., query adaptive convolution) module is introduced into the front end of the backbone network, and can adjust the parameters and sizes of convolution kernels to adapt to the scale changes in cow targets and input images. At the same time, NAM (i.e., normalization-based attention module) attention is embedded into the backend of the network to achieve the feature fusion in the channels and spatial dimensions, which contributes to better distinguish visually similar individual cows. The experiments are conducted on the public datasets collected from different cowsheds. The experimental results showed that the Rank-1, Rank-5, and mAP metrics reached 96.8%, 98.9%, and 95.3%, respectively. Therefore, the proposed model can effectively capture and integrate multi-scale features of cow body appearance, enhancing the accuracy of individual cow identification in complex scenes.