Training loss convergence
Fig 3(a) illustrates the evolution of the training losses, including box loss, classification loss and distribution focal loss (DFL), over 25 epochs. All three loss components exhibit a consistent downward trend throughout training, indicating stable optimization and effective learning of object localization and classification features. The box loss decreases from 3.10 in the first epoch to 0.99 at epoch 25, reflecting a substantial improvement in bounding box regression accuracy. Similarly, the classification loss declines from 3.87 to 1.06, demonstrating enhanced class discrimination capability as training progresses. The DFL loss also shows steady convergence, reducing from 4.06 to 1.56, which suggests improved modeling of bounding box distributions and localization confidence. Minor fluctuations observed around epochs 13-15 are typical during intermediate training stages and may be attributed to model adjustments as it learns more complex feature representations. Overall, the smooth convergence of the training loss curves indicates stable optimization during model learning. Because validation loss was not analyzed, these results alone cannot confirm the absence of overfitting. Nevertheless, the stable validation precision, recall and mAP trends indicate consistent validation performance during training; however, they do not replace a dedicated overfitting analysis using validation-loss comparison.
Precision and recall performance
The precision and recall trends across epochs are presented in Fig 3(b). During the early training stages, both metrics exhibit instability, particularly within the first five epochs, which is expected as the model initially struggles to generalize meaningful object features. Precision improves substantially after epoch 6, increasing from below 0.30 to above 0.80 by the final epoch. This indicates a marked reduction in false positive detections as the model becomes more confident in its predictions. Recall also shows a steady upward trend, rising from near-zero values in the initial epochs to 0.75 at epoch 25. This improvement suggests that the model progressively learns to detect a higher proportion of true objects in the dataset. The balanced growth of both precision and recall implies that the detector achieves an effective trade-off between detection accuracy and completeness, which is crucial for reliable wildlife detection under the evaluated conditions.
Mean average precision analysis
Fig 3(c) presents the progression of mean average precision (mAP) at different IoU thresholds. The mAP@50 increases sharply from 0.01 in the first epoch to 0.83 at epoch 25, highlighting the model’s strong detection capability under a moderate IoU criterion. In contrast, the mAP@50-95 curve grows more gradually, reaching 0.61 by the final epoch. This behavior is expected, as stricter IoU thresholds demand higher localization accuracy. The widening gap between mAP@50 and mAP@50-95 during early epochs gradually narrows as training progresses, indicating improved bounding box refinement and spatial accuracy. The final validation metrics indicate improved detection and localization performance during training. However, these results reflect performance on the validation subset and do not establish generalization to independent datasets. These results demonstrate that the training configuration enables efficient learning and stable convergence, making the model effective for the evaluated wildlife detection task.
Confusion matrix for each class
The performance of the African wildlife detection model was evaluated using both a confusion matrix and class-wise detection metrics, including precision, recall and mean Average Precision (mAP). The confusion matrix (Fig 4) summarizes the object-level classification performance of the model across the four target wildlife species: buffalo, elephant, rhino and zebra.
Among the four species, zebra recorded the highest number of correctly classified detections, with 275 correctly identified instances. Rhino exhibited the lowest misclassification rate, whereas buffalo showed a comparatively higher number of misclassified instances. Several classification errors were observed between elephant and rhino, while additional errors involved zebra predictions being assigned to elephant and rhino classes. Overall, the confusion matrix indicates that the YOLOv8 model achieved strong class discrimination while maintaining relatively low inter-class confusion across the four wildlife categories.
Class-wise detection performance
Class-wise detection performance (Table 1) further demonstrates the effectiveness of the YOLOv8-based wildlife detection model. Precision values ranged from 0.780 for elephants to 0.923 for zebras, indicating that most predicted detections corresponded to the correct wildlife classes. Recall values ranged from 0.814 for elephants to 0.916 for rhinos, demonstrating the ability of the model to identify a high proportion of annotated instances for each species.
The mAP@50 values were consistently high across all classes, ranging from 0.813 for elephants to 0.855 for rhinos, indicating reliable object localization at an IoU threshold of 0.50. The stricter mAP@50-95 metric ranged from 0.564 for zebras to 0.693 for rhinos, reflecting the increased difficulty of achieving precise bounding-box localization across multiple IoU thresholds. Among the evaluated classes, rhino achieved the strongest localization performance based on mAP@50-95, while zebra achieved the highest precision value. Elephant detection showed comparatively lower performance, which may be associated with occasional confusion with visually similar large-bodied species.
The performance values reported in Table 1 correspond to the standard object-detection evaluation generated by the Ultralytics YOLOv8 validation pipeline after applying the confidence threshold (0.25) and non-maximum suppression (IoU = 0.70). Therefore, precision, recall, mAP@50 and mAP@50-95 incorporate matched detections, unmatched false-positive predictions and missed ground-truth objects according to the object-detection evaluation protocol. These values are not calculated solely from the displayed confusion matrix, which represents matched class predictions only.
Qualitative outputs of the YOLO-based wildlife detection model
Fig 5 presents representative qualitative outputs of the YOLO-based wildlife detection model on test images. The model successfully detects and localizes multiple African wildlife species, including rhino, buffalo, zebra and elephant, with high confidence scores ranging from 0.86 to 0.93. Bounding boxes are accurately aligned with animal bodies under varying backgrounds, poses and scales.
The qualitative examples illustrate successful detections under varying visual conditions, including differences in animal pose, object scale, partial occlusion and complex natural backgrounds. These observations provide visual evidence of successful model predictions; however, they should not be interpreted as quantitative evidence of robustness because no separate performance analysis based on object size, illumination conditions, or occlusion levels was conducted.
The results include examples such as partially occluded rhino and elephant instances, buffalo appearing within vegetation and zebra images captured from different viewpoints. These examples illustrate successful predictions on selected test images but do not represent a complete assessment of model robustness. However, additional evaluation using challenging field conditions and systematically categorized datasets is required to determine the generalization capability of the model under diverse wildlife monitoring scenarios.
Representative failure cases, including missed detections, false-positive predictions, low-confidence detections and heavily occluded animals, were also observed during testing but are not comprehensively presented in Fig 5. Future studies should include detailed failure-case analysis and quantitative evaluation across different object sizes, illumination levels, occlusion categories and environmental conditions.
Comparison of recent wildlife detection studies highlights differences in models, datasets, species categories and evaluation protocols (Table 2).
Senbagam and Bharathi (2024) evaluated a single-stage YOLO-based detector on multiple wildlife species under varying environmental conditions and reported a mAP of 93.8%.
Roy et al., (2022) proposed WilDect-YOLO, which incorporated CSPDarknet53, residual and DenseNet-based feature extraction, SPP and modified PANet modules, achieving mAP of 96.89%, F1-score of 97.87%, precision of 97.18% and an inference speed of 59.2 FPS on their dataset.
Kim (2026) applied YOLOv8 for tiger detection using 4,413 images from the ATRW dataset and reported a mAP of 0.944.
Nagaraj et al., (2025) evaluated YOLOv8 using 9,000 images containing tigers, deer and elephants and reported accuracy of 89.26%, sensitivity of 81.7%, precision of 83.6% and specificity of 91.5%.
The studies included in Table 2 were selected because they addressed wildlife object detection; however, differences in datasets, species categories, annotation protocols, evaluation thresholds and reporting standards prevent direct numerical comparison.
However, direct numerical comparison among these studies is challenging because differences exist in dataset size, species composition, annotation procedures, evaluation metrics, IoU thresholds, hardware configurations and experimental protocols. Therefore, the reported values are presented only as contextual information regarding different wildlife detection approaches and should not be interpreted as a definitive ranking of model performance.
The present study evaluates YOLOv8n for four African wildlife species: buffalo, elephant, rhino and zebra. The model achieved precision values ranging from 0.780 to 0.923, recall values from 0.814 to 0.916, mAP@50 values from 0.813 to 0.855 and mAP@50-95 values from 0.564 to 0.693. These results demonstrate the detection capability of the YOLOv8n model on the evaluated African Wildlife Dataset under the defined experimental protocol. However, the transferability of these results to other wildlife environments, including independent camera-trap, drone-acquired, or field-collected datasets, remains unvalidated.
Several limitations should be considered when interpreting the reported results. First, the model was evaluated using only one publicly available benchmark dataset and external validation using independent wildlife datasets was not performed. Second, inference speed, computational efficiency, model size, memory consumption and energy requirements were not experimentally measured; therefore, real-time deployment capability cannot be concluded from the current study. Finally, comparisons with alternative object detectors, different YOLOv8 variants using the same dataset split and augmentation ablation experiments would provide additional insights into the contribution of model architecture and training strategies and should be investigated in future work.