# Real-Time Farm Surveillance Using IoT and YOLOv8 for Animal Intrusion Detection
## 2 Methodology and Implementation
### Intrusion Detection
#### 2.1.7 Versions of YOLO Used
Neck: The features that the backbone extracted are further refined by this section of the network. Using modules like CUC (maybe a cross-stage feature fusion technique), ELAN, and REP (presumably indicating repetition or residual connections), it integrates features of various sizes. The spatial pyramid pooling module that pools features on different scales and concatenates them to capture contextual information at several levels may be referred to as the SPPCSPC block. Prediction: The last step makes predictions about object detection based on these enhanced attributes. This allows the network to recognize objects of different sizes. It consists of a sequence of convolutional layers and detection blocks (called Detect 1, Detect 2, and Detect 3) that most likely correlate to the different scales at which objects are detected. The 'Detect' blocks produce predictions for their respective scales, while the 'Conv' layers modify the dimensionality of the features for the ultimate prediction. YOLOv7 is well known for its many uses in real-time object identification. Its outstanding speed and accuracy make it ideal for situations requiring fast decision-making based on visual input. This approach has found applications in a variety of sectors, including autonomous cars, surveillance systems, and, most famously, the SFSS. YOLOv7's key strengths are its ability to perform object detection jobs in real time, its exceptional accuracy in recognizing objects across many classes, and its adaptation to various hardware configurations. The use of YOLOv7 in the framework of the SFSS allows for the speedy and precise detection of intruders in agricultural areas, whether they are animals or people. Its ability to scan live video feeds and provide warnings instantly adds considerably to crop protection and reducing any damage or theft. The SFSS's use of YOLOv7 underscores the model's reputation as a must-have for real-time item identification in complicated, dynamic contexts. * Backbone: In order to recognize objects of varying sizes, the model uses a multi-scale method, analyzing the input picture at several resolutions (P1 to P5). In order to capture complicated information, the backbone employs a sequence of convolutional (Conv) layers with different kernel sizes, strides, and padding. These layers gradually reduce their spatial dimensions while increasing their depth (channels). In order to combine low-level and high-level features for a more comprehensive representation of the input data, C2F blocks most likely reflect cross-stage feature fusion. - Head (YOLOv8 Head): The head is made up of many detection blocks that anticipate object classes, bounding boxes, and objectness scores at various scales (P3, P4, P5). The model's architecture demonstrates parallel processing at various sizes, enabling it to handle bigger items with efficacy while retaining good resolution for little objects. In order to increase localization and classification accuracy during training, Figure 9 recommends using sophisticated approaches such as CIoU and BCE loss functions. Details: A thorough explanation of certain procedures like Bottleneck, SPPF, and Conv is given; they are crucial parts of the model that help keep computation efficient and refine feature maps. The model's capacity to retain spatial information is improved by fusing information across multiple levels of the feature hierarchy through the use of skip connections and upsampling approaches. The employment of normalization and nonlinear activation functions to enable quicker and more stable training is shown by the use of BatchNorm2d and SiLU (Sigmoid Linear Unit) activation. * Detect (Detection Layers): Each detection block uses a number of convolutions prior to generating final predictions, and detection layers are customized to the particular scale of the features. These layers most likely include class probability predictions and anchor box changes, which are essential for determining the precise location and class of objects in the picture.