Design and development of a near-real-time cattle counting system for estimation of greenhouse gases emissions from cattle
Abstract
The escalating contribution of livestock-related greenhouse gas (GHG) emissions to Uganda's anthropogenic emissions, accounting for approximately 18%, poses a critical environmental challenge. Existing methods for estimating these emissions rely heavily on outdated and manually collected historical data, leading to delayed and imprecise assessments. To address this issue, there is an urgent need to employ artificial intelligence (AI) technologies to facilitate near-real-time cattle counting and improve the accuracy of greenhouse gas emission estimations from cattle. This study proposed the use of deep learning techniques to automate the detection and counting of cattle from UAV-acquired videos, utilizing the resulting cattle count to estimate greenhouse gas emissions, specifically enteric methane (CH₄) and nitrous oxide (N₂O), using IPCC Tier 1 methodologies. A state-of-the-art object detection algorithm, YOLOv8, was trained on 1,161 images of cattle from three farms in Mubende district: Kisombwa Ranching Scheme, Kaygenzi Farm, and Buwegi Farm. These images were acquired, preprocessed, and annotated using the Roboflow image annotator. The YOLO object detector model, utilizing a convolutional neural network (CNN) architecture, was employed to develop the proposed cattle detection algorithm. A tracking-by-detection approach was used for counting the cattle by applying the SORT (Simple Online and Real-time Tracker) algorithm. This approach tracks each detection by assigning a unique identity (ID) to each bounding box. The developed model showed promising results in object detection tasks, achieving an average precision of 93%, recall of 82.9%, and an F1-score of 88.7. A near-real-time processing pipeline was established using the Create React App (CRA), a JavaScript library that powers interfaces, input fields, and displays the processed images sent by the backend. The backend was configured using Django, a high-level Python web framework, to manage application settings. The web application was deployed on Amazon Web Services (AWS), ensuring efficient operation with a minimal time lag of 10 second s. The estimation of enteric methane (CH₄) and nitrous oxide (N₂O) emissions from cattle was achieved using the Tier 1 methodology established by the Intergovernmental Panel on Climate Change (IPCC). The highest CH₄ emissions were recorded from the Kisombwa Ranching Scheme, followed by Buwegi Farm and Kaygenzi Farm. This trend was consistent for N₂O emissions as well. The cumulative emissions across all farms were 1,492,778.7 kg CO₂e yr⁻¹ for methane and 205,386.55 kg CO₂e yr⁻¹ for nitrous oxide, leading to a total of 1,698,165.25 kg CO₂e yr⁻¹.