Abstract
We present MultiCamCows2024, a farm-scale image dataset filmed across multiple cameras for the biometric identification of individual Holstein-Friesian cattle exploiting their unique black and white coat-patterns. Captured by three ceiling-mounted visual sensors covering adjacent barn areas over seven days on a working dairy farm, the dataset comprises 101,329 images of 90 cows, plus underlying original CCTV footage. The dataset is provided with full computer vision recognition baselines, that is both a supervised and self-supervised learning framework for individual cow identification trained on cattle tracklets. We report a performance above 96% single image identification accuracy from the dataset and demonstrate that combining data from multiple cameras during learning enhances self-supervised identification. We show that our framework enables automatic cattle identification, barring only the simple human verification of tracklet integrity during data collection. Crucially, our study highlights that multi-camera, supervised and self-supervised components in tandem not only deliver highly accurate individual cow identification, but also achieve this efficiently with no labelling of cattle identities by humans. We argue that this improvement in efficacy has practical implications for livestock management, behaviour analysis, and agricultural monitoring. For reproducibility and practical ease of use, we publish all key software and code including re-identification components and the species detector with this paper, available at https://tinyurl.com/MultiCamCows2024.
Keywords: Animal biometrics, Smart farming, Holstein-Friesian, Self-supervised learning, Re-identification
Fig. 8. Overview.

An overview of our proposed dataset samples, camera layouts and workflow. Selecting videos filmed by 3 adjacent, ceiling-mounted cameras in a working farm (upper-left), we crop tracklets and apply metric learning for cattle re-identification (right). The lower-left sections shows cropped and re-scaled sample visuals of 10 out of 90 unique cows showing one sample per camera. The same individuals are depicted in columns covering rows 1-3 and 4-6, respectively, using one row per camera view. Note the variance in viewpoint, lighting conditions, as well as dirt and condensation on the optics as appearing in real world farm settings.
1. Introduction
Monitoring of Animals
Today, sensor-based approaches for the study of animals including animal biometrics (Kühl and Burghardt, 2013) play a crucial role in various aspects of biological and veterinary research and practice (Aguilar-Lazcano et al., 2023). They provide a critical tool for the implementation of animal conservation and welfare policies (Tuia et al., 2022; Reynolds et al., 2024). Vision-based Artificial Intelligence (AI) methodologies, in particular, have become the technology of choice (Pollock et al., 2025) for applications related to species conservation and biodiversity assessment (Roy et al., 2023; Karaderi et al., 2024) as well as smart farming (Li et al., 2021; Andrew et al., 2020). In these settings, modern machine learning approaches often boost precision, efficiency, and flexibility of the monitoring tasks at hand. AI tasks range from species recognition, tracking and pose estimation, body condition scoring, behaviour detection and individual animal re-identification (Re-ID).
Motivation for Dairy Cattle Identification
In agriculture specifically, keeping track of individuals in time and space by performing Re-ID tasks is a key requirement that underpins many applications ranging from welfare assessment to production management activities such as growth monitoring, estrus detection, and precision insemination timing. We note that Holstein-Frisian cattle are a particularly important species for which to focus efforts, as they form a foundation for dairy farming in many regions of the world. Moreover, the utilisation of 24/7 monitoring methods for this species promises wide-reaching improvements in both efficiency and also welfare in the dairy sector (Akdeniz and Fidan, 2022). However, expanded roll-out of such domain-specific AI systems first requires further improvements both in terms of a reduction in the amount of human input required for training, but also in the accuracy of system outputs. In any case, self-supervised cattle monitoring via Computer Vision (CV) is a particularly promising avenue due to the remote operation of cameras without the need for physical sensor contact or reader stations positioned very close to the animals.
Single Camera Systems
Andrew et al. (2017, 2019, 2021) were one of the first to introduce automated CV frameworks for localisation and individual recognition of Holstein-Friesians based on their unique and (nearly) population-universal black and white coat patterns. To train these frameworks, datasets from single cameras were gathered from static (Gao et al., 2021, 2022) and dynamic (Andrew et al., 2019) observation platforms, then manually labelled, and finally used as information to facilitate deep machine learning for system construction. Yet, the required labelling work took weeks of manual labour and such a simple label-train-deploy strategy suffers from high re-commissioning cost, since species-generic features are repetitively retrained from scratch to allow for application to new herds or farms.
Scenarios, Efficiency, and Transferability
Using both individual and species-encompassing knowledge, based on large datasets followed by limited fine-tuning has been acknowledged as one efficient approach for the training and running of farm surveillance applications. To this end, Gao et al. (2021), for instance, created a relatively large single-camera dataset to enable experimentation regarding the minimisation of human-labelling for the identification of individual Holstein-Friesian cows from top-down CCTV. Their work demonstrated the importance of self-supervision by reducing reliance on human labelling, establishing it as a strong backbone candidate for learning transferable representations to identify targets and guide future research. However, using a single top-down camera limits identification to one view. It provides little knowledge regarding realistic monitoring performance for scenarios where multiple cameras are needed to cover a farm — possibly with overlapping fields of view. Consequently, customised retraining becomes unavoidable when applying a single-camera model across a multi-camera setup with varying angles, heights, and hardware configurations, significantly increasing human labour as the number and diversity of cameras grow.
Objective: A Dataset for Multi-camera Monitoring
Therefore, we introduce the first large, fully annotated, multi-camera dataset of Holstein-Friesian cattle with angled viewpoints taken on a working farm to study and develop a truly realistic and practically reusable monitoring scenario for dairy farms. Fig. 1 illustrates the varying viewpoints of the system and the Graphical Abstract shows examples of cattle images as taken by the various cameras. We propose efficient baseline monitoring approaches with such a setup, report on the dataset’s properties, and quantify results of deep learning approaches for automated re-identification of individual cattle for easy reproducibility and application. Firstly though, we will review the state-of-the-art in more detail and further explore why a dataset of the type introduced here is required to further the domain.
Fig. 1. Multi-Camera Setup in our dataset.

The three views: cameras 1, 2, and 3 from left to right, three different times vertically. The cameras are positioned so as to best capture cows following their regular milking routine. Cameras 1 and 2 view a narrow milk-race which widens out in camera 3. In this wider area, cows are more likely to be stationary, resulting in an imbalanced image dataset. Additionally, the cow detection regions of interest are shown in the bottom row.
2. Background
2.1. Re-identification and farm systems
Supervised Deep Learning for Static Domains
Across domains, fully-supervised deep learning has achieved remarkable results regarding target categorisation and localisation, and is the technology of choice for Re-Identification systems. Yet, its heavy reliance on fixed, annotated data at training time does not deal well with some common problems, such as the introduction of new animals with novel patterns. Training large classifiers from scratch under such settings is inefficient and often not feasible in practical, economically constrained settings.
Learning in Dynamic Data Domains
Adaptive transfer learning and self-supervised learning have aided address such dataset-wide scenarios by transferring meaningful knowledge from an existing model onto unlabelled datasets that retain some structure (e.g. the same animal species — even if patterned completely differently). Reliant on a ResNet backbone and spectral embedding analysis and able to propose accurate identification over smaller batches of data efficiently, Pathak (2020) refined earlier human Re-ID tools through inner fine-graining across spatial subregions of latent space. Thérien et al. (2023) then extended this Re-ID framework for 3D depth sensor applications by utilising PointNet and ViT. We note that these approaches are, in principle, fully applicable to the Holstein-Friesian cattle Re-ID task.
State-of-the-Art for Cattle Re-Identification Systems
Sharma et al. (2024) utilise depth data for universal bovine identification from top-down images, while Bhole et al. (2019) introduced a pipeline fusing standard RGB and thermal images to monitor individual cows. Recent work by Dubourvieux et al. (2023) involved a Cumulative Unsupervised Multi-Domain Adaptation (CUMDA) strategy for Re-ID tasks over multiple coat pattern-centred cow datasets (Bhole et al., 2019; Gao et al., 2021) with varied perspectives, lighting, and occlusion. Their work suggests that unsupervised strategies may have an advantage over self-supervision since the latter contained a higher cost for pre-labelling diversely conditioned images. However, given mainly torso information, Gao et al. (2022) exploited a self-supervision strategy for fast Re-ID built on a top-down view dataset of Holstein-Friesian cows only. We hypothesise that self-supervision strategies and new datasets can be exploited further for transferring and generalising species-specific identification knowledge across varied visual conditions — albeit requiring the construction of a true multi-camera dataset.
2.2. Species recognition
CNN-based Object Recognition
Deep residual CNNs and their derivatives are the most widespread toolkits for semantic detection and segmentation. The introduction of region proposal networks (RPNs) allowed for performing such tasks faster and perform real-time segmentation tasks. Later, pyramid-shaped networks utilised stacking region selection with inter-layer knowledge to acquire multi-level features. Knowledge of the previously trained semantic segmentation model can also be further distilled for transfer learning over advanced and detailed features. Based on these and related approaches, animal recognition and even behaviour analysis has not only been applied to wild species (Sakib and Burghardt, 2020), but also to Holstein-Friesian cattle (Nguyen et al., 2021) including work by Andrew et al. (2019) proposing a drone-based, automatic CNN framework to monitor Holstein-Friesian cows from the air.
Transformer-based Object Recognition
Precise segmentation performance in higher-resolution images is often reduced when using a traditional CNN architecture due to the fixed-sized operations within blocks. An alternative, first used in language models, introduces various versions of Vision Transformers (ViT) to the task of object recognition. However, ViTs and similar architectures face challenges regarding effective token sampling and correlation acquisition. In response, Fayyaz et al. (2021) boosted ViT performance with an adaptive token sampling module and Yu et al. (2022) replaced attention layers with a pooling module and built a lightweight model on top of a general MetaFormer architecture.
Reliable Species Detection
Expanding on earlier, pioneering work by Andrew et al. (2017, 2019, 2021) and others, cattle species detection is a widely solved task where both CNN and Transformer solutions enable reliable detection (Sharma et al., 2024; Wang et al., 2024a). Potential detection errors may still occur in domains with high levels of occlusion, low image quality or highly unusual viewpoints. However, whilst detection can utilise datasets of the species agnostic to individual appearance, individual animal re-identification is by no means a fully solved challenge and approaches must pay close attention to individual variability across viewpoints that can cover a whole farm — these properties are largely inaccessible in previous datasets related to re-ID.
2.3. Individual identification
Construction of Latent Spaces for Individuals
In order to classify a population, a network is usually tasked with mapping the visual appearance of individuals into a distinctly clustered latent space, where clusters relate to individuals. Contrastive learning can be used to shape such a space and metric learning (Andrew et al., 2021), in particular, aims at building the space such that distances in latent space reflect the relationships between the instances of the population. Chen et al. (2020) built SimCLR in which faster and more accurate results can be learned via a selection of prior data augmentation. They utilised Normalised Temperature-scaled Cross Entropy Loss (NTXentLoss) to maximise the distance between all unique labels. We utilise metric learning for clustering the individually-indicative latent space building on work by Gao et al. (2022). Before discussing these experiments we will first outline how the core dataset was collected and prepared.
3. Methodology
3.1. Dataset acquisition
Filming on a Working Farm
Videos of Holstein-Friesian cows were acquired daily, shortly after each animal departed an automatic milking system. Three spatially adjacent cameras positioned along a narrow walkway (see Fig. 1) were used. All videos were acquired during the lunchtime milking session (12:00 PM–2:00 PM) using HikVision DS-2CD5546G0-IZHS IP cameras running at a framerate of 25FPS and a resolution of 2560 × 1440 pixels per frame. The videos from each camera were encoded as MP4 files on-device and downloaded remotely for processing (see Fig. 2).
Fig. 2. Processing Pipeline Overview.

Our framework consists of three parts. First, we train and apply the species identifier (left) to acquire tracklets of cows from the video series. Then, we merge tracklets of cows over cameras. Human inspections at this stage and guarantees tracklet correctness and integrity (middle). Finally, we train and evaluate our metric learning modules (right) for individual Re-ID on both supervised and self-supervised pipelines. Note that no manual labelling of cattle IDs is required in the latter.
3.2. Tracklet generation and refinement
Species Detection and Tracklet Generation
Adapted from previous works by Gao et al. (2021), we first applied animal detection (Andrew et al., 2021) to the farm footage in order to extract cattle locations for each frame in the CCTV video (see Fig. 3). We trained this species detector for cow torso recognition using pre-trained weights from ImageNet for ResNet-152 as our backbone. We adapted the tools from NVIDIA Computer Vision Toolkit1 to perform head-oriented, rotated bounding box detections, which are later normalised so that all images to have the same orientation — i.e. the cow is always seen walking left-to-right in the dataset. Due to the wide visual range of views, we limited detection to a region of interest (RoI) in the cattle lane for each camera (see Fig. 1). Finally, we fine-tuned our species detector via Adam optimiser using 5,606 annotated frames across three selected views. Fig. 4 shows a training and performance overview for this species detector.
Fig. 3. Species Identification.

An overview of our Species Identifier. Initially (upper), we train an arbitrary cow detector using image datasets with COCO format annotations. (a) represents a good image inference (blue) compared to ground-truth (red), whereas (b) contains false positives (yellow). After cycles of tuning and retraining, we then apply the trained model (lower) on videos for each of the cameras. (c) is an example of detections from two different cameras. Cattle are grouped to eventually generate camera-variant tracklets (d) of cow torsos.
Fig. 4. Species Detector Training and Performance.

Training metrics (mean average precision (mAP) and mean average recall(mAR)) 4(a) and losses 4(b) for our species detector, with a detailed table of test set metrics.
Tracklet Generation
Bounding box information of cow torsos are next collected into raw tracklets covering individual cattle passing the cameras. We sample the CCTV video at 5 Hz to generate frames. Simple heuristics regarding cow movement and changes of direction are used to automatically concatenate detections from each consecutive frame into tracklets. In practice, we assume that cows cannot move more than 120 pixels and rotate drastically beyond 45° between contiguous frames. Additionally, we manually checked the integrity of tracklets and removed segmentations with less than 80% of a valid torso or those containing overlapping crops due to multiple cows standing too closely together. Furthermore, we manually refitted crops affected by proximity errors ad hoc to maximise tracklet quality in the dataset. As we assume one tracklet per cow per day, the results of cleaned tracklets across seven days have labels referring to the same set of cows.
Therefore, daily merging of identification (ID) tags was carried out based on the first day for each cow to enable later learning. Note that the final version of tracklets in the dataset still contains imbalanced frame quantities (see Fig. A.8) and sizes (Fig. A.9 for full details) across views. It can be seen from the floor plan (Fig. 1) that each camera has disparate RoIs. Cows from both cameras 1 and 2 walk in a straight line in the middle, whereas camera 3, having several exits, leads to many more stationary cows waiting to leave the facility. Ultimately, we have merged the raw, separate tracklets of individuals into a smaller set of refined tracklets, each representing progress of a cow across all three cameras. Within a given camera, bounding box sizes of moving cows contain variations due to different camera elevations and the inherent perspective effect as cows get closer to the camera. The average size of our tracklet crops is 568 × 264, and more information on dataset metadata can be found in Appendix.
3.3. Cattle re-identification
Latent Space Construction
After generating uniformly-labelled tracklets which now reflect the 90 total cows we have collected features from, we proceeded to conduct supervised (Fig. 5-(a)) and self-supervised (Fig. 5-(b)) learning. Subsequently, we evaluate performance. Both identification approaches employed ImageNet pre-trained ResNet18 backbones responsible for embedding images into feature vectors of the latent space. Before inputting images into the models, we normalise them to have a uniform size and photometric variance. Our training dataset comprises tracklets from the initial five days of data. Day six was used for validation — and day seven as the test set. Training was conducted via the AdamW optimiser at a learning rate of 0.001 sampled at 201 epochs (chosen due to minimal validation loss at this point) using an NVIDIA RTX2080Ti system with 48 GB of GPU memory. Training ran for 2873 min overall. The full training process is illustrated in Fig. 4 (left).
Fig. 5. Deep Metric Learning. Schematic Overview of our metric learning modules.

Supervised (a) adapts a classifier structure for predicting correct cow labels (IDs). Self-supervised (b) firstly trains with pseudo-labels (tracklet number) via metric learning. Then this model is used with the ground-truth (IDs) for evaluation and embedding visualisation.
Loss Function, Evaluation, and Experimental Setup
Within the supervised framework, we employ a model incorporating cross-entropy loss and a one-hot classifier on top of the reshaped images. To address variations in quantity amongst individuals (i.e. class imbalances), we sample images of individuals with equal probability for training. Within the self-supervised framework, a linear layer was utilised to generate multi-dimensional feature vectors for metric learning purposes. The NTXentLoss (Chen et al., 2020) was used as a contrastive loss function. It encourages distance reduction of items having the same label in latent space while moving these items away from those with contrasting labels. To ensure that the ground-truth identities of the cows could not ‘leak’ into the self-supervision process, pseudo-labels were used (effectively randomising the order in which cows appeared daily). For testing our unsupervised classifier, the ground-truth labels were used and KNN clustering was applied to evaluate performance. Both the supervised and self-supervised frameworks have been trained using NVIDIA GeForce RTX 2080 Ti GPUs.
4. Results
Re-Identification Performance
Here we present results on the task of individual identification based on training from tracklets as described above. Table 1 represents the quantitative performance of our supervised classifier and self-supervised identifier, respectively, where we compared the results of training for each independent camera and also with them all combined. For our classifier trained via supervised methods, the performance of merging the camera views reached the best accuracy result at 96.06% with the cropped image size being 128 × 128 using a 32D-embedding. This is marginally inferior to camera 1 performance (96.78%), but is significantly improved compared to previously published single camera performance in slightly different settings benchmarked at 76.9% accuracy as reported for Cows2021 (Gao et al., 2021). Self-supervision demonstrated a small overall increase in performance when merging multiple views together as shown in Table 1. When training with our ResNet18 backbone with images resized to 128 × 128, combining views leads to an accuracy of 96.36%, boosting the performance of camera 1, 2 and 3 by 0.48%, 3.62%, and 39.67% respectively. With more images causing dataset imbalance, the relatively large gap between the performance of camera 3 versus the combined views was due to the cows in camera 3 being mostly stationary (they tend to stop walking after the milk-race, so group together making it difficult to disambiguate individuals accurately). Cattle detection in dense groups (due to a camouflaging effect of the coat pattern) is a truly difficult task not solved to the same quality levels as standard object detection. Fig. 7 and Appendix A.2 provide visualisations of embeddings obtained during inference from self-supervision. Additionally, in Fig. 6 we show the confusion matrices of ground truth vs. prediction. Note that pattern similarity remains the major reason for misidentification. For instance, cow 035 is often misclassified as cow 031 due to the similarity of their body patterning from the rear and the side.
Table 1. Metrics table.
Quantitative analysis of both supervised and self-supervised classifiers from single and multiple cameras.
| Data set | Hyperparameters | Supervised Inference (%) |
Self-Supervised Inference (%) |
|---|---|---|---|
| AllCameras | Res18; img128; hid32 | 96.06 | 96.36 |
| Camera1 | Res18; img128; hid32 | 96.78 | 95.88 |
| Camera2 | Res18; img128; hid32 | 95.44 | 92.74 |
| Camera3 | Res18; img128; hid32 | 91.72 | 56.69 |
| AllCameras | Res18; img128; hid64 | 94.99 | 95.93 |
| Camera1 | Res18; img128; hid64 | 95.61 | 91.26 |
| Camera2 | Res18; img128; hid64 | 94.95 | 89.52 |
| Camera3 | Res18; img128; hid64 | 93.02 | 83.57 |
Fig. 7. Self-supervised embedding visualisations.

Visualisations on feature embeddings based on UMAP. Row (left) visualises KNN from training embeddings alone, while (right) projects test data into the embedding space constructed on the training data.
Fig. 6. Confusion matrices.

Confusion matrices of ground truth (true) versus prediction (pred) labels from the fused and all three singular cameras trained with the ResNet18 backbone, image size of 128 and a hidden dimension of 64. For each instance, examples of false positives are highlighted and shown with corresponding image samples on the right side. Note that cow No. 035 is often misinterpreted as cow No. 031. As seen from the image crops, they share an almost identical body pattern, with their rears being completely white and their lower side having black clusters of similar position and orientation.
K-Fold Cross Validation
In addition, we applied K-Fold Cross Validation (KFCV) to fully evaluate model test performances in both fully- and self-supervised settings(Table 2). We chose the standard k = 10 for cross validation after shuffling all the data for our fully-supervised pipeline. Since data formatting and training logic are significantly different for our self-supervised pipeline where cows were categorised in dates before in ID labels, we chose a customised k = 7 based on 7 days from our data source for cross-validation. To avoid deviating from our training details, we sequentially cycle through each of 7 days as the test set and perform training and validation from the remaining 6 days, with 5 days as the training set and one as validation.
Table 2.
K-Fold cross validation table. K-Fold Cross Validation of both fully- and self-supervised frameworks. Shown are two hyper-parameter settings with Hid32 (upper rows) and Hid64 (lower rows). Subset Mean (Mean) with Standard Deviation and Confidence Intervals (CI) from single and multiple cameras.
| Dataset | Supervised | Self-Supervised | |||
|---|---|---|---|---|---|
| Mean (%) | CI(p = 0.95) (%) | Mean (%) | Cl(p = 0.95) (%) | ||
| AllCameras | 99.01 ± 1.09 | [98.18, 99.83] | 91.70 ± 5.84 | [85.87, 97.53] | |
| Camera1@Hid32 | 99.76 ± 0.28 | [99.55, 99.97] | 82.70 ± 8.60 | [74.11, 91.29] | |
| Camera2@Hid32 | 98.72 ± 0.95 | [98.00, 99.43] | 84.36 ± 6.80 | [77.57, 91.15] | |
| Camera3@Hid32 | 98.45 ± 1.39 | [97.31, 99.58] | 52.95 ± 13.37 | [39.60, 66.31] | |
| AllCameras | 99.63 ± 0.22 | [99.47, 99.81] | 87.87 ± 2.84 | [85.03, 90.71] | |
| Camera1@Hid64 | 99.91 ± 0.08 | [99.85, 99.98] | 76.34 ± 9.60 | [66.75, 85.92] | |
| Camera2@Hid64 | 99.50 ± 0.32 | [99.26, 99.74] | 83.37 ± 4.61 | [78.77, 87.98] | |
| Camera3@Hid64 | 99.32 ± 0.27 | [99.12, 99.53] | 47.61 ± 10.66 | [36.96, 58.26] | |
5. Discussions
Reliable Automation of Training from Tracklets
The findings from the self-supervision framework indicate that automated identification can be reliably achieved when presented with cattle walking between successive cameras at periodic intervals provided clean tracklets are available. This observation underscores the substantial potential for autonomous surveillance systems across whole farms having multi-camera coverage tailored to dairy cattle. Furthermore, our self-supervised results show that human intervention as part of the monitoring process can widely be eliminated given high accuracies of the system outputs and no requirement for labelling of any individual cattle during system training.
Performance Improvements via Camera Integration
In addition, the self-supervised framework demonstrates superior performance using information from multiple cameras, outperforming their individual camera counterparts due to the enriched feature diversity for each label. Performance is improved compared to previous studies in similar settings (Gao et al., 2021, 2022). From the baseline of our study, the same methodology can be potentially expanded towards camera systems of diverse heights, angles and perspectives. Conversely, thecollective performance of the supervised classifier over the amalgamated camera dataset, while improved compared to some individual camera views, does not consistently surpass the performance when data from all cameras are used. As mentioned previously, the successful self-supervised training of the framework eliminates, the most time-consuming part of human labelling – that is labelling individuals – altogether. This, together with the performance gains made by merging data from disparate cameras, improves the viability of the visual ID approach on a commercial farm. Additionally, despite contributing a significantly larger number of images and introducing dataset imbalance, Camera 3 exhibited noticeably poorer performance compared to the combined views. This analysis demonstrates that quantity imbalance alone does not necessarily improve single-camera performance over combined views, as the diversity of image features plays a crucial role in identification accuracy.
Cross Validation
The results of K-Fold cross-validation on the supervised pipeline indicate an overall increase in mean performance and stability compared to our standard training workflow. This improvement is attributed to the higher proportion of training data in the dataset compared to that in the standard workflow. With k set to 10, 90% of the total data was used for training, which is greater than the proportion obtained through the uniform sampling used in the supervised workflow. As described in Section 4 - Results, we implemented a customised K-Fold cross-validation approach to replicate our designed training process, where k was set to 7 to account for the full permutation of selecting one day as the test set. Due to the inherent daily biases in our dataset, this cross-validation setup resulted in higher variance and slightly lower average performance compared to the supervised pipeline.
5.1. Future works
Open-Set Implementation
In target re-identification applications, one of the main issues is that of how to deal with new individuals that were never part of the original training set. This happens on dairy farms fairly frequently as heifers enter the milking herd. Identifying possible new individuals is known as the open-set problem (Liu et al., 2019; Ghaffari et al., 2023; Wang et al., 2024a), and solving this is an open challenge. In such scenarios, manual re-labelling of these unknown entities is not desirable. One possible solution to this problem is to build a classifier capable of deciding whether a cow is indeed ‘new’ or not, as in Wang et al. (2024b).
Towards Fully Automatic Tracking
In the context of proposing automated cattle identification methods, our current pipeline operates within certain constraints imposed by the available data. Firstly, the proximity of the selected cameras facilitates seamless transitions of cattle within frames, minimising abrupt changes in the morphology of cattle appearance. However, extending the framework to environments with cameras positioned with a greater degree of variance (either in distance or viewing angle) may necessitate extended training periods and could result in diminished performance due to the broader range of features that must be accommodated. Secondly, the observed cattle typically traverse the monitored area exactly once during each period. This very constraint allows us to use the contrastive NTXent loss function; once a cow has been seen once, it must be different to all other cows observed over that period, and hence must reside in a unique part of the embedding space. In more open environments, for instance, in feeding and drinking zones, this would not necessarily be the case, and the same loss function would no longer be so appropriate. We also rarely see cows standing together very closely in our data, allowing us to detect and localise them accurately. Once again, elsewhere on the farm, this may not be so true.
6. Conclusions
We introduced MultiCamCows2024, the first dataset consisting of multi-day images of Holstein-Friesian cows covered by multiple distinct cameras in a working farm. We performed supervised and self-supervised experiments using both merged and single cameras alone to test if fusing camera views enhances cow re-identification. We found that within our closed-set, fusing data across cameras boosts the performance of the cattle re-identification task over that of simply using each view independently (assuming the same level of data utilisation).
Supplementary Material
Acknowledgements
Open Access funding was provided by the Biotechnology and Biological Sciences Research Council (BBSRC) under grant ID BB/X017559/1.
All authors have read and agreed to the published version of the manuscript.
Footnotes
CRediT authorship contribution statement
Phoenix Yu: Writing – review & editing, Writing – original draft, Visualization, Validation, Software, Resources, Methodology, Investigation, Formal analysis, Data curation, Conceptualization. Tilo Burghardt: Writing – review & editing, Supervision, Methodology, Conceptualization. Andrew W. Dowsey: Resources, Funding acquisition, Formal analysis. Neill W. Campbell: Writing – review & editing, Writing – original draft, Supervision, Project administration, Methodology, Formal analysis, Conceptualization.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Data availability
Both code and data are available at https://phoenix4582.github.io/MultiCamCows2024.github.io/.
References
- Aguilar-Lazcano CA, Espinosa-Curiel IE, Ríos-Martínez JA, Madera-Ramírez FA, Pérez-Espinosa H. Machine learning-based sensor data fusion for animal monitoring: Scoping review. Sensors. 2023;23(12):5732. doi: 10.3390/s23125732. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Akdeniz M, Fidan ED. A study on behavior and welfare characteristics of Holstein cattle in manure and sand beddings in free-stall barns. Vet J Mehmet Akif Ersoy Univ. 2022;7(2) [Google Scholar]
- Andrew W, Gao J, Mullan S, Campbell N, Dowsey AW, Burghardt T. Visual identification of individual Holstein-Friesian cattle via deep metric learning. Comput Electron Agric. 2021;185:106133 [Google Scholar]
- Andrew W, Greatwood C, Burghardt T. Visual localisation and individual identification of holstein friesian cattle via deep learning; Proceedings of the IEEE International Conference on Computer Vision Workshops; 2017. pp. 2850–2859. [Google Scholar]
- Andrew W, Greatwood C, Burghardt T. Aerial animal biometrics: Individual friesian cattle recovery and visual identification via an autonomous uav with onboard deep inference; 2019 IEEE/RSJ International Conference on Intelligent Robots and Systems; 2019. pp. 237–243. [Google Scholar]
- Andrew W, Greatwood C, Burghardt T. Fusing animal biometrics with autonomous robotics: Drone-based search and individual id of friesian cattle; Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision Workshops; 2020. pp. 38–43. [Google Scholar]
- Bhole A, Falzon O, Biehl M, Azzopardi G. A computer vision pipeline that uses thermal and RGB images for the recognition of holstein cattle; Computer Analysis of Images and Patterns: 18th International Conference, CAIP 2019, Salerno, Italy, September 3–5, 2019, Proceedings, Part II; 2019. pp. 108–119. [Google Scholar]
- Chen T, Kornblith S, Norouzi M, Hinton G. A simple framework for contrastive learning of visual representations; International Conference on Machine Learning; 2020. pp. 1597–1607. [Google Scholar]
- Dubourvieux F, Lapouge G, Loesch A, Luvison B, Audigier R. Cumulative unsupervised multi-domain adaptation for holstein cattle re-identification. Artif Intell Agric. 2023;10:46–60. [Google Scholar]
- Fayyaz M, Kouhpayegani SA, Jafari FR, Sommerlade E, Joze HRV, Pirsiavash H, Gall J. Ats: Adaptive token sampling for efficient vision transformers. arXiv preprint. 2021:arXiv:2111.15667 [Google Scholar]
- Gao J, Burghardt T, Andrew W, Dowsey AW, Campbell NW. Towards self-supervision for video identification of individual holstein-friesian cattle: The cows2021 dataset. arXiv preprint. 2021:arXiv:2105.01938 [Google Scholar]
- Gao J, Burghardt T, Campbell NW. Label a herd in minutes: Individual holstein-friesian cattle identification. Image Analysis and Processing; ICIAP 2022 Workshops: ICIAP International Workshops, Lecce, Italy, May 23–27, 2022, Revised Selected Papers, Part II; 2022. pp. 384–396. [Google Scholar]
- Ghaffari R, Helfroush MS, Khosravi A, Kazemi K, Danyali H, Rutkowski L. Towards domain adaptation with open-set target data: Review of theory and computer vision applications R1# C1. Inf Fusion. 2023:101912 [Google Scholar]
- Karaderi T, Burghardt T, Morard R, Schmidt DN. Deep visual-genetic biometrics for taxonomic classification of rare species; Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision; 2024. pp. 7115–7125. [Google Scholar]
- Kühl HS, Burghardt T. Animal biometrics: quantifying and detecting phenotypic appearance. Trends Ecol Evolut. 2013;28(7):432–441. doi: 10.1016/j.tree.2013.02.013. [DOI] [PubMed] [Google Scholar]
- Li G, Huang Y, Chen Z, Chesser GD, Jr, Purswell JL, Linhoss J, Zhao Y. Practices and applications of convolutional neural network-based computer vision systems in animal farming: A review. Sensors. 2021;21(4):1492. doi: 10.3390/s21041492. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Liu H, Cao Z, Long M, Wang J, Yang Q. Separate to adapt: Open set domain adaptation via progressive separation; 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition; 2019. pp. 2922–2931. [DOI] [Google Scholar]
- Nguyen C, Wang D, Von Richter K, Valencia P, Alvarenga FA, Bishop-Hurley G. Video-based cattle identification and action recognition; 2021 Digital Image Computing: Techniques and Applications; 2021. pp. 01–05. [Google Scholar]
- Pathak P. Fine-grained re-identification. arXiv preprint. 2020:arXiv:2011.13475 [Google Scholar]
- Pollock LJ, Kitzes J, Beery S, Gaynor KM, Jarzyna MA, Mac Aodha O, Meyer B, Rolnick D, Taylor GW, Tuia D, et al. Harnessing artificial intelligence to fill global shortfalls in biodiversity knowledge. Nat Rev Biodivers. 2025:1–17. [Google Scholar]
- Reynolds SA, Beery S, Burgess N, Burgman M, Butchart SH, Cooke SJ, Coomes D, Danielsen F, Di Minin E, Durán AP, et al. The potential for AI to revolutionize conservation: a horizon scan. Trends Ecol Evolut. 2024 doi: 10.1016/j.tree.2024.11.013. [DOI] [PubMed] [Google Scholar]
- Roy AM, Bhaduri J, Kumar T, Raj K. WilDect-YOLO: An efficient and robust computer vision-based accurate object localization model for automated endangered wildlife detection. Ecol Informatics. 2023;75:101919 [Google Scholar]
- Sakib F, Burghardt T. Visual recognition of great ape behaviours in the wild. arXiv preprint. 2020:arXiv:2011.10759 [Google Scholar]
- Sharma A, Randewich L, Andrew W, Hannuna S, Campbell N, Mullan S, Dowsey AW, Smith M, Hansen M, Burghardt T. Universal bovine identification via depth data and deep metric learning. arXiv preprint. 2024:arXiv:2404.00172 [Google Scholar]
- Thérien B, Huang C, Chow A, Czarnecki K. Towards object re-identification from point clouds for 3D MOT. arXiv preprint. 2023:arXiv:2305.10210 [Google Scholar]
- Tuia D, Kellenberger B, Beery S, Costelloe BR, Zuffi S, Risse B, Mathis A, Mathis MW, van Langevelde F, Burghardt T, et al. Perspectives in machine learning for wildlife conservation. Nat Commun. 2022;13(1):1–15. doi: 10.1038/s41467-022-27980-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Wang R, Gao R, Li Q, Zhao C, Ru L, Ding L, Yu L, Ma W. An ultralightweight method for individual identification of cow-back pattern images in an open image set. Expert Syst Appl. 2024a;249:123529 [Google Scholar]
- Wang B, Li X, An X, Duan W, Wang Y, Wang D, Qi J. Open-set recognition of individual cows based on spatial feature transformation and metric learning. Animals. 2024b;14(8):1175. doi: 10.3390/ani14081175. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Yu W, Luo M, Zhou P, Si C, Zhou Y, Wang X, Feng J, Yan S. Metaformer is actually what you need for vision; Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; 2022. pp. 10819–10829. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
Both code and data are available at https://phoenix4582.github.io/MultiCamCows2024.github.io/.
