This repository contains the source code that accompanies our paper "Label a Herd in Minutes: Individual Holstein-Friesian Cattle Identification" at: https://arxiv.org/abs/2105.01938. (watiting archive)
- Clone this repository.
- Install any missing requirements via pip or conda: numpy, PyTorch, OpenCV, Pillow, tqdm, sklearn, seaborn. This repository requires python 3.6+
- Use a computer with GPU for training.
To replicate the results obtained in our paper, please use the Cows2021 dataset. The training data in in Cows2021 Dataset/Sub-levels/Identification/Train Download. The test data in Cows2021 Dataset/Sub-levels/Identification/Test Download.
Replace the path of the training dataset in config.py with your own path. To train the model, use python train.py -h
to get help with setting command line arguments. Examples of runing the code with fully supervised mode or metric learning mode are in run.txt
. The training dataset is in Cows2021 Sub-levels/Train
.
Merge tracklets from the training dataset: Datasets/make_retrain
Replace the merge dataset to the origianl one and run train.py
to finetune the model.
To test a trained model, see run.txt
.
We excluded poor quality data from the test data of Cows2021. Please see Datasets/data_list.txt
to find the test data using in our paper and run Datasets/selection.py
to move these data to a new folder.
Consider citing ours and William's works in your own research if this repository has been useful:
@article{gao2021towards,
title={Towards Self-Supervision for Video Identification of Individual Holstein-Friesian Cattle: The Cows2021 Dataset},
author={Gao, Jing and Burghardt, Tilo and Andrew, William and Dowsey, Andrew W and Campbell, Neill W},
journal={arXiv preprint arXiv:2105.01938},
year={2021}
}
@article{andrew2020visual,
title={Visual Identification of Individual Holstein Friesian Cattle via Deep Metric Learning},
author={Andrew, William and Gao, Jing and Campbell, Neill and Dowsey, Andrew W and Burghardt, Tilo},
journal={arXiv preprint arXiv:2006.09205},
year={2020}
}