Biotecnología en el Sector Agropecuario y Agroindustrial (Apr 2024)
Evaluation of two computer vision approaches for grazing dairy cow identification
Abstract
Computer vision is being used in Precision Livestock Farming to monitor and analyze animal health, behavior, and productivity. However, the implementation of these technologies faces technical challenges that require collaboration between farmers, researchers, and technology providers. In this study, the performance of two different grazing dairy cow identification approaches was compared using a ResNet-based computer vision model. The first approach consisted of image classification, while the second approach was based on the comparison of features or embeddings. The YOLOv5 model was used to detect and classify cows in images captured with three high-definition cameras on a dairy farm. A database consisting of two main folders: "TRAIN" and "TEST" was generated based on 19 Holstein dairy cows. Each folder contains 19 subfolders numbered from 001 to 019, corresponding to each cow. The approaches for the identification of cows were trained and validated using 4740 and 2256 images, respectively. FastAI was used for training the ResNet50 model in the first approach and the open-source PyTorch ReID project in the second. Validation tests of the models trained with the approaches were performed and the results were compared using a confusion matrix and five performance metrics. The results indicate that the embedding comparison approach performed significantly better in all validation tests compared to the image classification approach. This suggests that the embedding comparison approach is a more robust and accurate technique for the identification of Holstein cows under diverse conditions, which has great potential for its application in the implementation of automated monitoring systems for dairy farms. In summary, this study shows that computer vision is a valuable tool to improve the productivity and health of animals in Precision Farming.
Keywords