Milkalyser: Recognising Cows with Computer Vision
“It’s been quite an education working with academics like Dmitry and seeing how they do things. It's so valuable just knowing where to look to take it further ourselves. ”
Dr Ben BruntChief Information Officer
The Dairy Industry is a significant part of Devon’s economy. While its foundations are built upon centuries-long heritage, it remains attractive to vibrant innovative enterprises. One of them is Milkalyser, a multidisciplinary team of physicists, statisticians and agricultural scientists, aimed at dairy industry improvements, with a particular focus on fertility. They aim to improve industrial efficiencies while also protecting animal welfare. They are developing a variety of solutions, including prediction of the fertility cycles in cattle and using innovative machine vision approaches to track the herd and monitor animals’ wellbeing.
The Milkalyser team has collaborated with the Impact Lab to develop a cow recognition system to replace traditional tagging systems, which can be costly for farmers to implement and maintain, and potentially invasive for the animals. A functional electronic identification system is a pre-requisite for farmers to be able to implement the Milkalyser fertility testing system. Currently the overheads of implementing a new electronic tagging system can be a barrier for Milkalyser as they speak with new potential clients. By developing a new, low-cost, easy-to-install identification solution, Milkalyser will be able to access a larger market, as well as providing an additional value-add service. A machine vision solution transfers the complexity into software and data analytics, meaning that the on-site installation can be as simple as setting up a few cameras.
The project team has included members of the University of Exeter, the Met Office and Rothamsted Research. The University of Exeter helped Milkalyser to develop the identification algorithm, adapting the existing methods used for identification of humans; the Met Office and Rothamsted were responsible for delivering domain-specific data, such as weather archive data and image datasets on existing cattle, respectively.
The approach, proposed by the University of Exeter team, splits into two stages: cow detection and cow identification. Both modules rely on photos of cows, namely front and rear views.
In the cow detection stage, the computer scans images to pick up when there is a cow in an image, drawing a bounding box around each cow. The computer is taught how to detect a cow by providing a training dataset where the bounding boxes have been manually added by humans. The computer can then use this known data to identify common visual aspects which give a high probability that a given object is a cow. In order to ensure that cows can be detected in a variety of circumstances, the model needs to be optimised with a large enough dataset of cows in different positions.
In the cow identification stage, the model needs to distinguish between different cows. To achieve this, a method developed for human identification was retrained and adapted to apply to cattle. The given method relies upon the idea of construction of different appearances of the same person by composing together different parts of the structure, such as different types of clothes for humans or various aspects of appearance in cows. Doing this enriches the training set and allows to separate between the features, crucial for distinguishing between different cows, and those which are irrelevant to the task. This method would enable a cow to be identified from their visual features rather than requiring physical tagging.
The project has been developed using the pangeo system, a Met Office project, in collaboration with high profile organisations across the world, to deliver high performance computation framework to enable scientists to draw insights from Big Data. The Pangeo project promotes open, reproducible, and scalable science.
The project has delivered a prototype for a cow recognition system, which is comprised of separate modules for cow detection and cow identification. While these modules are based on the latest state-of-the-art methods, they have been updated and adapted for the purpose of cattle identification by the University of Exeter.
- Dr Ben Brunt, Chief Information Officer
- David Shotter, Data Analyst
- Toby Mottram, Founder
- Kathryn White, Innovation Manager, University of Exeter
- Dr Dmitry Kangin, Industrial Research Fellow, University of Exeter
- Dr Khalid Mahmood, Innovation Manager, Rothamsted Research