# Detection of Threats to Farm Animals Using Deep Learning Models: A Comparative Study
###### Abstract  
The increasing global population and environmental changes pose significant challenges to food security and sustainable agricultural practices. To overcome these challenges, protecting farm animals and effectively detecting potential environmental threats is critical for economic and ecological sustainability. In this context, the current study examined the animal detection capabilities and efficiency of advanced deep learning models, such as YOLOv8, Yolo-NAS, and Fast-RNN, across a dataset of 2462 images encompassing various animal species that could pose a risk to farm animals. After converting the images into a standardized format, they were divided into three sets for training, validation, and testing, and each model was evaluated on this dataset during the analysis process. The findings indicated that the YOLOv8 model demonstrated superior performance, with 93% precision, 85.2% recall, and 93.1% mAP50 values, while Yolo-NAS was particularly noteworthy for its high recall value, indicating a remarkable detection ability. The Fast-RNN model also offered significant efficiency with balanced performance. The results reveal the considerable potential of deep learning-based object detection technologies in protecting farm animals and enhancing farm security. Additionally, this study provides valuable insights for future model optimization and customization research. animal detection; farm security; object detection technologies; image processing; deep learning +
Footnote †: journal:  
Considering the limited natural resources and rising production pressures, sustainable methods and increased efficiency are necessary. Animal welfare and environmental impact management are critical in modern livestock farming [5; 6]. [PERSON] [1] highlights that manual processes in animal husbandry might be inadequate and that new systems and technologies must be developed for high efficiency. In this context, Precision Livestock Farming (PLF) and Industry 4.0 technologies play a significant role in achieving efficiency and sustainability goals in livestock farming [7]. The threat posed by wild animals to farm animals is a significant issue for agricultural security. Damage caused by wildlife to agricultural production leads to severe economic losses globally. In North America and Europe, 3% of local livestock businesses are affected by such damages, while the figure rises to 18% in Africa and Asia [8]. To overcome this problem, there is a need for technological solutions that can effectively monitor and manage wildlife in addition to traditional methods. Computer vision, as a field aimed at obtaining information about the world from images, involves the analysis of characteristics such as shape, texture, and distance [9]. On the other hand, machine learning deals with developing algorithms intended for extracting information from large datasets, some specifically designed to solve computer vision problems [10]. Advances focused on deep learning have provided innovative monitoring and control capabilities in many areas, including farming [11]. The general approach of farmers to acquire information about many animals is through visual observation, which is beneficial but costly and time-consuming. Traditionally, the classification of characteristics in live animals for diagnostic and imaging purposes relied on time-consuming and expensive methods. The development of computer vision systems holds the potential to automate these processes, offering high-efficiency phenotyping and extensive applications in livestock farming [12]. The primary aim of this study was to investigate the use of image processing technologies within the scope of Industry 4.0 for detecting wild animals and farm animals in precision livestock operations regarding meat safety and sustainability. This approach aims to reduce threats from wildlife and enhance livestock security. Thus, it could be possible to protect the welfare of farm animals while minimizing agricultural production losses.