Agricultural and Food Science (Jun 2022)

Deep learning image recognition of cow behavior and an open data set acquired near an automatic milking robot

  • Olli Koskela,
  • Leonardo Santiago Benitez Pereira,
  • Ilpo Pölönen,
  • Ilmo Aronen,
  • Iivari Kunttu

DOI
https://doi.org/10.23986/afsci.111665

Abstract

Read online

Production animals enjoying good health and well-being are more productive and have a higher output quality. Several technical solutions have been used to monitor the animals’ welfare: those based on computer vision provide cost-efficient and scalable options. In this work, we performed a continuous two-month image acquisition of cows in front of an automatic milking station and divided the data into ten different classes related to the most important activities appearing in the images. The data consisted of almost 19 hours of video, equivalent to more than 1.7 million still images. Based on these imaged, we then implemented a convolutional neural network classifier to recognize the cows' behavior. The network was tested using cross-validation methodology and achieved an 86% precision rate and 85% recall rate in the classification. The data and the Python program code used in this study are made available. An image data set that directly resembles the harsh conditions inside a barn and can be used for deep learning purposes has not been previously made available.