Table of Contents
Fetching ...

AI-Powered Cow Detection in Complex Farm Environments

Voncarlos M. Araújo, Ines Rili, Thomas Gisiger, Sebastien Gambs, Elsa Vasseur, Marjorie Cellier, Abdoulaye Baniré Diallo

TL;DR

This work tackles robust cow detection in complex farm environments by evaluating one-stage and two-stage detectors on a multicamera cow dataset. The authors introduce YOLOv8-CBAM, integrating the Convolutional Block Attention Module with YOLOv8 to address occlusions and lighting variability, achieving a notable improvement in $mAP$ and precision over baselines ($mAP@0.5:0.95=82.6\%$, precision $=95.2\%$). They demonstrate training under realistic conditions with six camera types (indoor and outdoor) and 1,115 images, showing strong generalization across settings and modest inference-time overhead. The study also analyzes optimizer choices (SGD vs Adam) and provides detailed comparisons against Mask R-CNN and YOLOv5, highlighting the practical value of attention-based enhancements for real-time livestock monitoring. Overall, the paper advances AI-driven livestock welfare by delivering a robust, scalable detector suitable for health monitoring, behavioral analysis, and tracking in smart farms.

Abstract

Animal welfare has become a critical issue in contemporary society, emphasizing our ethical responsibilities toward animals, particularly within livestock farming. The advent of Artificial Intelligence (AI) technologies, specifically computer vision, offers an innovative approach to monitoring and enhancing animal welfare. Cows, as essential contributors to sustainable agriculture, are central to this effort. However, existing cow detection algorithms face challenges in real-world farming environments, such as complex lighting, occlusions, pose variations, and background interference, hindering detection. Model generalization is crucial for adaptation across contexts beyond the training dataset. This study addresses these challenges using a diverse cow dataset from six environments, including indoor and outdoor scenarios. We propose a detection model combining YOLOv8 with the CBAM (Convolutional Block Attention Module) and assess its performance against baseline models, including Mask R-CNN, YOLOv5, and YOLOv8. Our findings show baseline models degrade in complex conditions, while our approach improves using CBAM. YOLOv8-CBAM outperformed YOLOv8 by 2.3% in mAP, achieving 95.2% precision and an mAP@0.5:0.95 of 82.6%, demonstrating superior accuracy. Contributions include (1) analyzing detection limitations, (2) proposing a robust model, and (3) benchmarking state-of-the-art algorithms. Applications include health monitoring, behavioral analysis, and tracking in smart farms, enabling precise detection in challenging settings. This study advances AI-driven livestock monitoring, improving animal welfare and smart agriculture.

AI-Powered Cow Detection in Complex Farm Environments

TL;DR

This work tackles robust cow detection in complex farm environments by evaluating one-stage and two-stage detectors on a multicamera cow dataset. The authors introduce YOLOv8-CBAM, integrating the Convolutional Block Attention Module with YOLOv8 to address occlusions and lighting variability, achieving a notable improvement in and precision over baselines (, precision ). They demonstrate training under realistic conditions with six camera types (indoor and outdoor) and 1,115 images, showing strong generalization across settings and modest inference-time overhead. The study also analyzes optimizer choices (SGD vs Adam) and provides detailed comparisons against Mask R-CNN and YOLOv5, highlighting the practical value of attention-based enhancements for real-time livestock monitoring. Overall, the paper advances AI-driven livestock welfare by delivering a robust, scalable detector suitable for health monitoring, behavioral analysis, and tracking in smart farms.

Abstract

Animal welfare has become a critical issue in contemporary society, emphasizing our ethical responsibilities toward animals, particularly within livestock farming. The advent of Artificial Intelligence (AI) technologies, specifically computer vision, offers an innovative approach to monitoring and enhancing animal welfare. Cows, as essential contributors to sustainable agriculture, are central to this effort. However, existing cow detection algorithms face challenges in real-world farming environments, such as complex lighting, occlusions, pose variations, and background interference, hindering detection. Model generalization is crucial for adaptation across contexts beyond the training dataset. This study addresses these challenges using a diverse cow dataset from six environments, including indoor and outdoor scenarios. We propose a detection model combining YOLOv8 with the CBAM (Convolutional Block Attention Module) and assess its performance against baseline models, including Mask R-CNN, YOLOv5, and YOLOv8. Our findings show baseline models degrade in complex conditions, while our approach improves using CBAM. YOLOv8-CBAM outperformed YOLOv8 by 2.3% in mAP, achieving 95.2% precision and an mAP@0.5:0.95 of 82.6%, demonstrating superior accuracy. Contributions include (1) analyzing detection limitations, (2) proposing a robust model, and (3) benchmarking state-of-the-art algorithms. Applications include health monitoring, behavioral analysis, and tracking in smart farms, enabling precise detection in challenging settings. This study advances AI-driven livestock monitoring, improving animal welfare and smart agriculture.
Paper Structure (23 sections, 8 equations, 12 figures, 6 tables)

This paper contains 23 sections, 8 equations, 12 figures, 6 tables.

Figures (12)

  • Figure 1: Cow dataset challenges: Indoors: (a) lighting conditions, (b) poses and orientations and (c) Background complexity. Outdoors: (d) scale and size, (e) camera angles and heights and (f) occlusions.
  • Figure 2: Pipeline Overview. A) Cow data collection; B) Data augmentation; C) Labeling data; D) Detection models; E) Model training and F) Model test and Comparative/Analysis
  • Figure 3: Framework of Mask R-CNN based cow detection.
  • Figure 4: YOLOv5 detection model.
  • Figure 5: Overview of the CBAM structure.
  • ...and 7 more figures