Success Story: Livestock Monitoring with Edge AI and HPC

Livestock Monitoring with Edge AI and High-Performance Computing

Livestock farming is vital to many economies (including Montenegro) but faces high labor costs, resource inefficiencies, and slow adoption of modern technology. Farmers traditionally monitor herds by manually counting and inspecting animals – a time-consuming and costly process that strains resources​. On large farms with hundreds of animals, keeping an eye on each cow or sheep is daunting and prone to human error. Issues such as stray, lost, or ill animals might go unnoticed until it’s too late, jeopardizing farm productivity and animal welfare. Clearly, there was a need for an innovative solution to augment farmers with real-time, automated livestock monitoring. The challenge was not just detecting animals with precision, but doing so efficiently in remote farm environments – a task requiring a leap in computational capability and reliable operation outside the lab. High-Performance Computing (HPC) offered a way forward, providing the computational muscle to develop advanced AI models that could meet these demands.

Solution

The research team developed a real-time livestock detection system that leverages state-of-the-art AI at the network’s edge. At its core is a deep learning model (YOLO v8) trained to recognize cattle in video feeds. To train this model effectively, the team harnessed HPC resources: using powerful GPU nodes, they could run intensive training jobs in a fraction of the time of a single PC. In fact, by offloading training to an HPC environment, the model achieved fast convergence – reaching about 65% accuracy after only 35 training epochs​. This roughly 30-minute training cycle (performed on a GPU-enabled platform) would have taken significantly longer on ordinary hardware, underscoring how HPC accelerated the development. Such HPC-driven training not only reduced time-to-results, but also enabled iterative tuning of the model to improve accuracy beyond what would be feasible on limited local machines. The resulting YOLOv8 model is optimized to detect large livestock in various poses and lighting conditions, providing a robust AI “eye” for the farm.

Detecting cattle in the field using Edge device with prediction model trained and fine tuned on HPC

Once trained, the model is deployed on an NVIDIA Jetson Nano – a small, energy-efficient edge computing device. The Jetson Nano, equipped with a quad-core ARM CPU and an NVIDIA GPU, offers excellent on-site processing power for running AI models. Cameras installed around the farm (for example, overlooking a pasture or barn) feed live video to the Jetson Nano via USB. The YOLOv8 model processes these streams in real time, identifying and localizing each cow in the frame with bounding boxes​. This means the system can automatically count the herd and even track individual movements without any invasive sensors or RFID tags on the animals. If the model detects that not all livestock are present in the designated area (for instance, if one wandered off or an area is empty), a Python script on the device immediately flags the discrepancy. The system can then send an instant alert to the farmer through a connected application, indicating how many animals are missing and from which zone. By using edge AI on the Jetson Nano, the solution avoids the latency of sending all video to the cloud; instead, it makes decisions on-site in milliseconds, which is crucial for timely notifications.

NVIDIA Jetson Nano developer kit – a compact edge device used to run the YOLOv8 object detection model on the farm. The Jetson processes video feeds from cameras in real time and on-site

To complement this on-site processing, the platform integrates with cloud infrastructure for data aggregation and remote access. Every 15 minutes, the Jetson Nano’s application uses a Wi-Fi connection to upload key data to a cloud database. Rather than streaming raw video, it sends summarized information – e.g. the current count of animals, their locations or statuses, and any alerts. Storing this data in the cloud serves multiple purposes. First, it provides scalability: a cloud database can handle the large amounts of data generated over weeks and months of monitoring, easily scaling as the farm or number of edge devices grows​. Farmers and ranch managers can log in to a dashboard to see historical records – tracking herd size over time, movement patterns, or the frequency of alerts. Such long-term data, stored securely and reliably off-site, enables trend analysis and strategic planning. For example, a farmer could generate weekly reports on pasture usage or identify if certain cattle tend to roam, information that can improve resource allocation. The cloud also ensures the data is accessible from anywhere (office, home, or on the go), which is invaluable for farmers who may manage multiple farm locations​. Robust security measures (encryption, access control, backups) provided by managed cloud services safeguard the information. In essence, the edge-cloud synergy of the system delivers real-time responsiveness on the ground, while centralizing intelligence and oversight on the cloud – a modern IoT approach to smart agriculture.

Differentiating dogs from cattle

Crucially, this entire solution was made possible by the High-Performance Computing support behind the scenes. HPC infrastructure was used to train and refine the deep learning model efficiently, something that would be infeasible on the Jetson Nano alone or a typical farm computer. By leveraging HPC-grade GPUs and parallel computing, the researchers dramatically shortened the AI model’s training time and were able to experiment with more complex model configurations without worrying about weeks of training delay. The HPC-enabled training pipeline ensured that the final model deployed to the edge was highly optimized and accurate within a reasonable development timeframe. This project, supported by the EuroCC initiative and the national HPC centre, exemplifies how HPC and AI can converge to solve real-world problems in agriculture. It demonstrates a blueprint for deploying cutting-edge AI models (trained on supercomputers) onto affordable edge devices in the field – effectively bridging the gap between laboratory-grade computation and on-site farm operations.

Benefits

The implementation of AI, edge computing, and HPC in livestock monitoring has led to numerous benefits:

  • Real-time livestock oversight: Farmers receive instant alerts if an animal goes missing or exhibits unusual behavior, enabling rapid response to issues (such as locating a strayed cow or checking on a possibly ill animal)​. This significantly improves animal safety and herd security by catching problems early.
  • Reduced labor and costs: The automated system continuously watches the herd, saving farmers countless hours of manual checking. This leads to lower labor costs and allows farm staff to focus on other important tasks instead of patrolling fields​. By easing the workload, the technology improves productivity and farm management efficiency.
  • Improved accuracy and consistency: Unlike human observation, the AI never tires or gets distracted. It applies the same detection criteria 24/7, rain or shine. This yields high consistency in counting and monitoring, minimizing human error. Early trials achieved about 65% detection accuracy with room for further improvement – a promising result that will only get better with more data and tuning. Over time, more accurate tracking of each animal’s whereabouts and activity can also support better herd health management.
  • Modernizing agriculture: Overall, the project is a leap towards the digital transformation of farming. It demonstrates how adopting AI and HPC can modernize traditional practices, making them smarter and more efficient.