47 Citations (Scopus)
284 Downloads (Pure)


Holstein-Friesian cattle exhibit individually-characteristic black and white coat patterns visually akin to those arising from Turing's reaction-diffusion systems. This work takes advantage of these natural markings in order to automate visual detection and biometric identification of individual Holstein-Friesians via convolutional neural networks and deep metric learning techniques. Existing approaches rely on markings, tags or wearables with a variety of maintenance requirements, whereas we present a totally hands-off method for the automated detection, localisation, and identification of individual animals from overhead imaging in an open herd setting, i.e. where new additions to the herd are identified without re-training. We propose the use of SoftMax-based reciprocal triplet loss to address the identification problem and evaluate the techniques in detail against fixed herd paradigms. We find that deep metric learning systems show strong performance even when many cattle unseen during system training are to be identified and re-identified - achieving 98.2% accuracy when trained on just half of the population. This work paves the way for facilitating the non-intrusive monitoring of cattle applicable to precision farming and surveillance for automated productivity, health and welfare monitoring, and to veterinary research such as behavioural analysis, disease outbreak tracing, and more. Key parts of the source code, network weights and underpinning datasets are available publicly.
Original languageEnglish
Article number106133
Number of pages14
JournalComputers and Electronics in Agriculture
Early online date30 Apr 2021
Publication statusPublished - 1 Jun 2021

Bibliographical note

Funding Information:
This work was supported by The Alan Turing Institute under the EPSRC grant EP/N510129/1 and the John Oldacre Foundation through the John Oldacre Centre for Sustainability and Welfare in Dairy Production, Bristol Veterinary School. We thank Suzanne Held, David Barrett, and Mike Mendl of Bristol Veterinary School for fruitful discussions and suggestions, and Kate Robinson and the Wyndhurst Farm staff for their assistance with data collection. Thanks also to Miguel Lagunes-Fortiz for permitting use, adaptation and redistribution of key source code.

Publisher Copyright:
© 2021 Elsevier B.V.

Copyright 2021 Elsevier B.V., All rights reserved.

Structured keywords

  • Jean Golding


  • Automated agriculture
  • Computer vision
  • Deep learning
  • Metric learning
  • Animal biometrics


Dive into the research topics of 'Visual identification of individual Holstein-Friesian cattle via deep metric learning'. Together they form a unique fingerprint.

Cite this