Manuscript Offprint

arXiv:2611.08928

UAV-Based Computer Vision for Cattle Detection and Feed Bunk Spatial Analysis

Pedro Oliveira Torrente, Diego Giaretta de Paulo, Lucas Pascotti Valem, Jianglong Yan, Everton Castelão Tetila, Jayme Garcia Arnal Barbedo, Liang Zhao

Pedro Oliveira Torrente Ⓤ, Diego Giaretta Ⓤ, Lucas Pascotti Valem Ⓤ, Jianglong Yan Ⓤ, Everton Castelão Tetila Ⓤ, Jayme Garcia Arnal Barbedo Ⓤ, and Liang Zhao Ⓤ

Abstract—Beef cattle production is central to Brazilian agribusiness and faces growing demands for efficiency, sustainability, and animal welfare. Precision Livestock Farming (PLF) offers tools to address these challenges, particularly through monitoring feeding-related spatial patterns in confined systems. Feeding management plays a decisive role in animal performance, yet its evaluation still relies largely on subjective, labor-intensive visual inspections that are hard to scale and prone to bias. This work proposes a computer vision framework based on Unmanned Aerial Vehicles (UAVs) to quantify cattle alignment and spatial dispersion at the feed bunk under real-world feedlot conditions. A UAV dataset was collected during flight campaigns at a commercial feedlot in Mato Grosso do Sul, Brazil. Images were manually annotated into cattle head and cattle back classes to support object detection and image-level spatial analysis of cattle distribution. You Only Look Once (YOLO) models, namely YOLOv8 and YOLOv11, were evaluated, with YOLOv8 small used for the downstream spatial analysis. The feed bunk region was segmented using the Segment Anything Model (SAM), and geometric metrics based on detected head positions were developed to characterize alignment, spacing regularity, and clustering. The selected detector achieved 84.30% mAP50 and 35.50% mAP50-95, with an inference time of approximately 2.7 ms per image on an NVIDIA RTX 5060 Ti GPU. The resulting metrics distinguished representative regular and irregular spatial distributions by Root Mean Square Deviation - RMSD (1.06 m and 4.26 m), Coefficient of Variation - CV (42.70% and 96.31%), and clustering (0 and 2 clusters), respectively. These findings indicate that the proposed approach can provide indicators for assessing feed bunk spatial patterns in PLF.

Index Terms—Computer Vision, Precision Livestock Farming, UAVs, YOLO, Object Detection, Deep Learning, Cattle

I. INTRODUCTION

Beef cattle production is central to Brazilian agribusiness and the global meat supply chain. Brazil ranks among the world's largest beef exporters, accounting for nearly 21% of global exports and an estimated herd of 194 million animals

in 2024, while generating millions of direct and indirect jobs [1]. In response to increasing global food demand and the need for sustainable intensification, livestock systems in Brazil have progressively incorporated digital technologies, artificial intelligence, and remote sensing tools to improve production efficiency, environmental sustainability, and animal welfare.

Traditional cattle monitoring remains a labor-intensive activity that demands time, specialized personnel, and substantial operational costs, particularly in extensive and confined production systems. In this context, Precision Livestock Farming (PLF) has emerged as a modern and strategic approach to livestock management. As defined by [2], PLF extends the principles of precision agriculture to animal production by enabling repeated and individualized monitoring [3], with the objective of optimizing animal performance, improving resource efficiency, and reducing environmental impacts. Advances in sensing and data acquisition technologies have enabled the collection of large volumes of behavioral and physiological data [4], supporting more accurate and timely management decisions [5].

Among the technologies driving this transition, Unmanned Aerial Vehicles (UAVs) have become increasingly popular due to their ability to rapidly acquire high-resolution images over large areas at relatively low operational expenses [6], [7]. When combined with computer vision and Deep Learning (DL), UAV imagery offers a powerful platform for key livestock management tasks, such as automated counting, weight estimation, and monitoring feeding-related spatial indicators [8], [9], while reducing subjectivity and improving the reliability of zootechnical indicators [10], [11].

In this work, we use a UAV-based dataset collected in a real-world feedlot experiment conducted by the UFGD research group at Campanário Farm, located in Mato Grosso do Sul, Brazil. The imagery was acquired across repeated flight campaigns, providing consistent overhead views. We manually annotated two complementary classes, cattle head and cattle back, to support both effective detection and a more interpretable analysis of animal orientation and spatial distribution at the feed bunk. In this study, feeding-related spatial indicators refer to image-level, instantaneous descriptors of cattle positions relative to the feed bunk, rather than temporal behavioral measurements such as visit frequency, feeding duration, or individual intake. Detecting the cattle head as a distinct class is a choice motivated by its relevance to feeding-related spatial interpretation. Head localization provides evidence of animal orientation relative to the feed bunk and proximity to it, while back detections support future applications such

Pedro Oliveira Torrente, Diego Giaretta, Lucas Pascotti Valem, and Jianglong Yan are with the Institute of Mathematics and Computer Science (ICMC), University of São Paulo (USP), São Carlos - SP, Brazil.

Everton Castelão Tetila is with the Federal University of Grande Dourados (UFGD), Dourados - MS, Brazil, and also with Embrapa Digital Agriculture, Campinas - SP, Brazil.

Jayme Garcia Arnal Barbedo is with Embrapa Digital Agriculture, Campinas - SP, Brazil.

Liang Zhao is with the Faculty of Philosophy, Sciences and Letters at Ribeirão Preto (FFCLRP); University of São Paulo (USP), Ribeirão Preto - SP, Brazil.

Corresponding author: Lucas Pascotti Valem (e-mail: lucas@icmc.usp.br).

This work involved no animal experimentation, handling, or intervention by the authors. The analysis was conducted exclusively on a pre-existing, publicly available dataset of non-invasive UAV imagery, in which cattle were remotely observed during their normal commercial feedlot routine.

as individual identification. This dataset enables evaluation of detection performance and feed bunk alignment metrics under realistic operational constraints.

Feeding management is a key determinant of animal performance in confined systems, and linear feed bunk space plays a central role in shaping competitive interactions among animals. Insufficient feed bunk space intensifies competition, letting dominant animals restrict access and increasing variability in intake and weight gain [12], while inadequate management can cause chronic underfeeding (limiting weight gain) or overfeeding (raising waste and ruminal acidosis risk) [13]. Therefore, accurate monitoring of feeding-related spatial distribution along the feed bunk is essential for optimizing nutritional management and ensuring animal welfare. Recent computer vision approaches have also explored automated monitoring of feed bunks, including individual animal identification and feed bunk condition scoring using overhead cameras and clustering techniques, demonstrating the potential of systems to support feeding management decisions [14].

Within this context, computer vision offers a promising alternative for evaluating cattle alignment and spatial patterns during observed feeding moments [15]. UAV imagery enables non-invasive, wide-area observation, allowing quantitative assessment of how animals distribute themselves around the feed bunk. This study combines deep learning based object detection with geometric analysis of cattle spatial arrangement. Detectors from the You Only Look Once (YOLO) family [16], specifically YOLOv8 and YOLOv11 [17] in configurations ranging from nano to extra large, are evaluated for cattle detection in aerial images. A feed bunk segmentation module defines a precise region of interest for more accurate alignment analysis, and geometric dispersion and uniformity metrics are then computed from the detected positions to support a data-driven evaluation of instantaneous feed bunk spatial patterns. The objective is to propose a computer vision approach using UAV imagery to detect cattle and quantify their spatial dispersion and feeding alignment through YOLO-based models and geometric metrics.

The novelty of this work lies in a practical framework that converts standard computer vision outputs into physical, task-specific geometric indicators for instantaneous assessment of cattle distribution along the feed bunk. The main contributions of this work are summarized as follows:

  • A UAV-based computer vision framework for non-invasive and image-level assessment of cattle spatial distribution at the feed bunk in UAV imagery.

  • A comparative evaluation of multiple YOLO-based object detectors (YOLOv8 and YOLOv11, across model sizes) applied to cattle detection under real farm conditions.

  • A feed bunk segmentation module that defines a precise region of interest for analyzing cattle alignment and spatial distribution at the feed bunk.

  • The development of geometric dispersion and uniformity metrics to quantify cattle distribution along the feed bunk, supporting data-driven monitoring of feed bunk occupation.

  • Experimental evidence that the proposed metrics quantify and discriminate contrasting spatial occupation patterns

at the feed bunk, providing a basis for future decision-support tools in feeding management.

The remainder of this paper is organized as follows. Section II reviews related work on UAV-based livestock monitoring, YOLO-based cattle detection, segmentation models, and feed bunk analysis. Section III describes the proposed methodology, including the dataset preparation, the training and comparison of YOLO detectors, the feed bunk segmentation procedure, and the geometric metrics used to quantify cattle alignment and dispersion. Section IV reports the experimental results, covering both effectiveness and inference time analyses and the evaluation of instantaneous feed bunk spatial patterns using the proposed metrics. Finally, Section V concludes the paper and outlines directions for future work.

References (39)

  • From traditionally extensive to sustainably intensive: A review on the path to a sustainable and inclusive beef farming in brazil
  • General introduction to precision livestock farming
  • Mhaff: Multihead attention feature fusion of cnn and transformer for cattle identification
  • A review of cattle behavior recognition methods based on computer vision and deep learning
  • Deep learning for visual animal monitoring (detection, tracking, pose estimation, and behavior classification): A comprehensive review
  • Perspectives on the use of unmanned aerial systems to monitor cattle
  • A review on the use of unmanned aerial vehicles and imaging sensors for monitoring and assessing plant stresses
  • Computer vision algorithms to help decision-making in cattle production (opens the publisher in a new tab)
  • Automatic cattle detection and counting system in aerial images using computer vision algorithms
  • A review of deep learning techniques for detecting animals in aerial and satellite images
  • Deep learning approaches for automatic livestock detection in uav imagery: State-of-the-art and future directions
  • Feeding behavior, feed space, and bunk design and management for adult dairy cattle
  • Controlling variation in feed intake through bunk management
  • 419 automated individual animal identification and feeding bunk scoring: a computer vision approach for beef cattle at calan gate feeding system (opens the publisher in a new tab)
  • Livestock feeding behaviour: A review on automated systems for ruminant monitoring
  • A comprehensive review of yolo architectures in computer vision: From yolov1 to yolov8 and yolo-nas
  • YOLOv11: An Overview of the Key Architectural Enhancements
  • Review: Precision livestock farming: building ‘digital representations to bring the animals closer to the farmer
  • Precision livestock farming applied to grazingland monitoring and management - a review
  • Counting cattle in uav images—dealing with clustered animals and animal/background contrast changes
  • Use of drones for trough reading, animal counting, and production monitoring in feedlot systems
  • Integrated unmanned aerial vehicle-based lidar and rgb data for individual cattle growth monitoring in precision livestock farming
  • Deep learning-based uav framework for automated morphological and growth analysis of feedlot cattle
  • A systematic survey of public computer vision datasets for precision livestock farming
  • Agricultural object detection with you only look once (yolo) algorithm: A bibliometric and systematic literature review
  • Cattle body detection based on yolov5-assf for precision livestock farming
  • Programming and setting up the object detection algorithm yolo to determine feeding activities of beef cattle: A comparison between yolov8sm and yolov10m
  • Segment anything
  • Enhancing agricultural image segmentation with an agricultural segment anything model adapter
  • Evaluating the efficacy of segment anything model for delineating agriculture and urban green spaces in multiresolution aerial and spaceborne remote sensing images
  • Cow detection and tracking system utilizing multi-feature tracking algorithm
  • Minimizing resource usage for real-time network camera tracking of black cows
  • PSXI-2 a computer vision system for feed bunk management in beef cattle feedlot
  • Dataset of feed bunk score images of cattle feedlot
  • Feed bunk score images classification using deep transfer learning (opens the publisher in a new tab)
  • Individual animal identification and feed grading using computer vision and unsupervised statistical clustering
  • Overcoming extreme sample scarcity: Deep learning-based real-time detection of cattle mounting behavior from uav imagery and video
  • A density-based algorithm for discovering clusters in large spatial databases with noise
  • A performance analysis of you only look once models for deployment on constrained computational edge devices in drone applications