## 3 Methodology
### Model: YOLOv8  
Deep learning has significantly advanced image classification, detection and segmentation [11]. The CNN-based deep learning model is exceptionally adept at accurately detecting and classifying images. This research primarily focuses on recognizing extinct animals and wildlife animals surrounding an agriculture field. To address this, an object-detection model, YOLOv8 was deployed using the deep learning architecture. YOLOv8 presents the most recent advancement in YOLO models, demonstrating state-of-the-art capabilities in object detection [25]. It is comprised of mainly three components, the backbone, neck and output layer. There is a prevailing assumption that the YOLO-v8 model will prioritize the deployment of limited edge devices with an emphasis on achieving high-inference speed [26]. Figure 2 illustrates the model of this research. \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Risk Criteria** & **Class Name** & **\# of Images** & **Source** & **Format** \\ \hline \multirow{6}{*}{Endangered} & Indian Crested Porcupine & 500 & & \\ \cline{2-5}  & Wild Elephant & 500 & & \\ \cline{2-5}  & Squirrel & 462 & & \\ \cline{2-5}  & Wild Boar & 400 & & \\ \cline{2-5}  & Vulture & 500 & & \\ \hline \multirow{3}{*}{Deleterious} & Bat & 500 & & \\ \cline{2-5}  & Rat & 500 & & \\ \cline{2-5}  & Goat & 500 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Dataset description. Figure 2: The architecture of the YOLOv8 model. Figure 2 presents the architectural description of this research. The proposed model has an input layer taking the input image dimensions 640 \(\times\) 640 \(\times\) 3. It consists of 9 convolutional layers for feature extraction and among these convolutional layers, there are 8 CSP layers incorporated to enhance the feature-extraction process and simplify information flow. YOLOv8 employs a comparable underlying architecture to YOLOv5, though with certain modifications made to the CSPLayer, which has been renamed the C2f module. The C2f module, referred to as the cross-stage partial bottleneck with two convolutions, was designed to improve the accuracy of detection by incorporating contextual information with high-level features. The CSPDarknet53 is used as a backbone which is further utilized to extract features from the images [27]. It creates a complementary low-resolution image and moves from pixel to pixel for feature extraction. A Cross-Stage Partial (CSP) module creates a features map from the extracting features and minimizes the duplication of information to enhance the model scalability. It also optimizes the process for a large-scale network. It uses a spatial pyramid pooling (SPP) [28] network to distinguish the contextual features and increase the receptive field in the final segment. After completing the feature-extraction process, the model includes a series of sampling and concatenation processes, which enhance its capability to identify animals. Next, the neck structure performs the feature-enhancement tasks. It employs an attention-based pyramid network to improve the feature-extraction ability. For this reason, the same object with different categories and shapes can easily be recognized [29]. Consequently, the overall detection accuracy is increased substantially. Finally, the model's output layer makes predictions, which consist of bounding boxes that outline the detected animals. The YOLOv8 algorithm incorporates the CIoU [30] and DFL [31] loss functions to calculate the bounding box loss, while binary cross-entropy is employed for classification loss. The aforementioned losses have demonstrated enhanced performance in the task of object detection, particularly in scenarios involving tiny objects. An additional contribution of the proposed work involves the development of a precisely refined and optimized detection model. Various hyperparameter settings were utilized in our study, including adjustments to the number of layers, batch size and learning rate, in order to optimize the results.