# Detection of Threats to Farm Animals Using Deep Learning Models: A Comparative Study
## 4 Results
Additionally, these values indicated that the model did not memorize. Figure 9 presents graphs of the precision, recall, Map 50, and Map 50-95 metrics and BoxLoss, ClassLoss, and ObjectLoss values over 100 epochs of YOLOv8 model operation. The notable improvements in precision and recall observed in the later epochs could indicate a significant advancement in the learning process, potentially due to adjustments in the learning rate or the influence of more effective feature extraction layers beginning to impact the model's performance. The stability observed in the mAP50, alongside enhancements in mAP50-95 and the recall rates for bounding boxes, suggests that the model was not only consistently detecting objects but was also increasingly proficient at ensuring that these detections were highly accurate in terms of both position and classification. This implies that the model was not just continuously detecting objects but was also enhancing its capability to ensure that those detections were precise in both placement and categorization. Figure 9: YOLOv8 metrics and loss graph. The study analysis results were examined class by class. The class-based metric parameters for the YOLOv8 model were extracted and are shown in Table 4.  
In Table 4, the model's performance in detecting various animal classes is presented in detail. The model's overall performance was impressive, with 93% precision, 85.2% recall, 93.1% mAP50, and 70.9% mAP50-95 values. Particularly for the birds of prey class, the model showed remarkable success, with 97.1% precision and 95.1% recall and recording a mAP50 of 99.2% and mAP50-95 of 83.7%. This indicated the model's high effectiveness in distinguishing birds of prey from other species. High precision and recall values were also observed for large mammals such as pigs, sheep, and cattle and predatory mammals like dogs, jackals, and foxes. The mAP50 values for each animal class were generally high, demonstrating the model's ability to detect various species accurately. However, mAP50-95 values were typically lower, indicating a decrease in model performance as the IoU threshold increased. These findings show that the model successfully detected various animal types, particularly excelling with specific species like birds of prey. Moreover, this study significantly contributes to the development of automatic detection systems to enhance farm security and protect poultry from potential threats. These results once again prove the effectiveness of deep learning models in animal detection and classification. In Figure 10, we present an example output from the YOLOv8 model applied to the task of detecting various wild and farm animals in natural and controlled environments. This figure illustrates the model's capacity to accurately identify and differentiate between species, showcasing bounding boxes that delineate individual animals. The high detection accuracy, as demonstrated in the figure, underscores the effectiveness of YOLOv8's enhanced deep learning architecture in handling complex image recognition tasks within diverse settings. The Table 5 provides a comprehensive comparison of the YOLO-NAS, Yolo v8, and Fast RNN models, highlighting key parameters such as training duration and processing speed, alongside performance metrics including precision, recall, and mAP50. The results offer valuable insights into how each model performs under various operational conditions. Notably, the Fast RNN model excels in environments with limited resources, demonstrating high processing speed and efficiency. The Yolo v8 model distinguishes itself with high accuracy in complex and densely populated backgrounds, while the Yolo-NAS model's exceptional recall rate indicates its ability to detect nearly all true objects, making it particularly effective for real-time monitoring scenarios. These findings underscore the suitability of these models for enhancing farm security and animal protection applications.