# Real-Time Farm Surveillance Using IoT and YOLOv8 for Animal Intrusion Detection
## 3 Results and Experiments
### Evaluation of the Models on the Farm Dataset  
Evaluating machine learning models on the Farm Dataset, which comprises photos from local farms, is crucial since it reflects the sorts of real-world scenarios in which the models are to be applied. The significance of this assessment arises from its ability to recreate the exact conditions and challenges that these models would face in real-world applications. The performance evaluation of the models using farm-specific data assures their responsiveness to the unique characteristics and problems associated with agricultural surveillance. This test validates the models' ability to perform successfully in a real-world context, where they must consistently recognize and categorize objects and intrusions in agricultural settings, proving their practicability. It analyzes not only their technical proficiency but also their potential to boost agricultural security and efficiency. Figure 18 compares the results of the models in the classification of images from the real farm dataset. Figure 19 illustrates the confusion matrices of four different neural network models--Inception, Xception, AlexNet, and VGG--which were tested for their ability to classify images into three distinct categories: 'animal', 'clear', and 'human'. A closer look at the results reveals some intriguing discoveries. In the case of the Inception model, there is substantial accuracy in detecting 'clear' images, but significant misclassifications in terms of 'animal' categorization. Meanwhile, Xception scores well, notably in properly recognizing 'human' images, but it is substantially worse at distinguishing 'animal' ones. Despite major difficulty in 'clear' classification, AlexNet delivers an exceptional overall performance. While the VGG model is good at recognizing 'clear' images, it has a hard time distinguishing between 'animal' and 'clear'. Every class in the Yolo V6 model shows some misunderstanding, most notably when 'clear' is mistakenly classified as 'person'. However Yolo V7 performs better, classifying 'animal' as accurately as possible, misclassifying 'clear' less frequently, and misclassifying 'human' in a tiny percentage of cases. The Yolo V8 model, on the other hand, remains the peak of precision, with few misclassifications and a noticeable advantage in accuracy. These matrices provide a visual framework for comparing the models' overall performance, enabling better model selection. Figure 18: Real-world implementation of the hardware. Table 5 contains extensive information on the performance of five distinct neural network models, including Inception, Xception, VGG16, AlexNet, and the versions of Yolo we used. An in-depth analysis of their performance reveals the following information. Inception accurately predicted the outcomes of 78% of the test samples. It has an impressive 77% precision, which implies that 77% of its positive classifications were right: Inception detected 77% of true positives, with a recall rate of 77% and an accuracy rate of 77%. Its F1_score of 76% also shows a solid mix of accuracy and recall. Xception lagged behind Inception in terms of its precision, which dropped to 67%, indicating that only 67%  
Figure 19: Confusion matrices of the performance of the models on the real farm dataset. of positive samples were genuinely positive. Its recall stayed at 77%, indicating that it could detect 77% of true positives. However, compared to Inception, its F1_score of 72% implies a modest decrease in accuracy. VGG16 effectively predicted the outcomes of 74% of samples, leading to a 74% accuracy. The precision of the model is 64%, which implies that 64% of its positive predictions were right. With a recall rate of 74%, VGG16 accurately spotted 74% of positive occurrences. The model's F1_score of 68% shows a balanced trade-off between precision and recall, however it is lower than that of Inception and Xception. AlexNet has a 72% accuracy, meaning it predicted the outcomes of 72% of the test samples accurately.