Training convergence and loss analysis
Fig 4(a) presents the evolution of the training loss components, including box loss, segmentation loss, classification loss and distribution focal loss (DFL). As shown by the training loss curves, all four loss components exhibit a consistent downward trend, indicating stable convergence and effective learning. The box loss decreased substantially from 2.926 in epoch 1 to 0.764 at epoch 50, reflecting progressive improvement in bounding box localization accuracy. Similarly, the segmentation loss declined from 3.818 to 1.268, demonstrating the model’s increasing ability to accurately delineate elephant regions in thermal imagery. The classification loss reduced from 3.273 to 0.740, indicating improved discrimination between elephant objects and background clutter. The DFL loss, which governs bounding box regression quality, steadily decreased from 1.964 to 0.923, confirming enhanced spatial precision. Minor fluctuations observed after epoch 40 are typical in deep learning training and suggest fine-grained parameter adjustments rather than instability.
Overall, the smooth convergence of all loss components confirms that the model successfully learned robust feature representations from the dataset without signs of overfitting or divergence.
Detection performance evaluation
The detection performance was assessed using precision, recall, mAP@50 and mAP@50-95 across epochs (Fig 4b). Precision improved sharply, rising from 0.028 in the initial epoch to 0.964 by epoch 50, indicating a strong reduction in false positive detections as training progressed. This trend highlights the model’s increasing confidence and selectivity when identifying elephants. The recall metric also showed consistent improvement, reaching 0.903 at epoch 50, which demonstrates the model’s capability to detect the majority of elephant instances present in the images. The balanced improvement in both precision and recall suggests that the model avoids the common trade-off where gains in one metric significantly degrade the other. The mean Average Precision at IoU 0.5 (mAP@50) reached 0.937, while the stricter mAP@50-95 achieved 0.676 by the final epoch. These values indicate strong detection accuracy under both lenient and stringent localization criteria. The gradual saturation of mAP after approximately epoch 30 suggests that the model reached optimal performance and additional training yielded marginal gains.
Confusion matrix interpretation
The confusion matrix in Fig 5 further illustrates the classification behavior of the model. The model achieved 512 true positives, correctly identifying elephant instances, while only 27 false negatives indicate a low miss rate. Additionally, 21 false positives were observed, representing background regions incorrectly classified as elephants. In object detection tasks, true negatives are not explicitly defined; therefore, the matrix focuses on meaningful detection outcomes.
The combined analysis of loss convergence, detection metrics and confusion matrix demonstrates that the YOLOv8 model is well-suited for elephant detection in thermal imagery. High precision ensures reliability in automated alerts, while strong recall minimizes the risk of missed detections. The achieved performance indicates significant potential for deployment in human-wildlife conflict mitigation systems, where timely and accurate elephant detection is critical.
Qualitative detection results on thermal images
In addition to quantitative evaluation, qualitative analysis was performed using sample thermal images to visually assess the detection capability of the YOLOv8 model. Representative detection outputs are illustrated in Fig 6, where elephants are correctly localized with high confidence scores of 0.93 and 0.91, respectively.
The results demonstrate that the model is able to accurately identify elephant shapes under challenging thermal conditions, including low contrast, motion blur and background clutter. In the first image (left), the elephant appears partially blurred and frontal in orientation, yet the model successfully encloses the entire body within a tight bounding box. This indicates strong robustness to shape deformation and posture variation. In the second image (right), the elephant is captured in a side-view position with clear limb separation and the detection box accurately aligns with the spatial extent of the animal. The consistently high confidence scores across different poses and viewing angles confirm that the model has learned discriminative thermal features specific to elephants rather than relying on background cues. Importantly, no spurious detections were observed in the surrounding regions, suggesting effective suppression of false positives. This behavior aligns with the high precision values observed during quantitative evaluation. These qualitative results further validate the effectiveness of dataset cleaning and model training. The use of sharpness-based filtering ensured that low-quality thermal images were removed prior to inference, enabling the model to focus on informative samples. As a result, detection outputs are visually stable and reliable, even when elephants appear blurred or partially occluded. From an application perspective, such reliable visual detection is critical for real-world deployment in forest surveillance and early warning systems.
Several recent studies have explored deep learning-based wildlife detection using YOLO architectures, primarily focusing on multi-species detection and architectural enhancements.
Nagaraj et al., (2025) proposed a real-time wildlife detection and tracking system based on YOLOv8, trained on approximately 9,000 RGB images to detect multiple animal species, including elephants. Their system demonstrated reliable performance under dense vegetation and low-light conditions, supporting safari management and conservation operations. However, their work relies on visible-spectrum imagery and addresses generalized wildlife detection, whereas the present study specifically targets elephant detection in thermal imagery, which is more suitable for night-time monitoring and low-visibility forest environments. Furthermore, this study provides a detailed analysis of training convergence and thermal-domain performance, which is not explicitly reported in
Nagaraj et al., (2025).
Chen et al., (2024) introduced YOLO-SAG, an improved YOLOv8n-based wildlife detection model that enhances detection accuracy and inference efficiency through architectural modifications, including Softplus activation, AIFI feature interaction and lightweight neck modules. Their contribution lies in optimizing the model structure to reduce computational cost while improving precision, recall and mAP on general wildlife datasets. In contrast, the present work does not modify the YOLOv8 architecture but instead emphasizes domain-specific dataset preprocessing and transfer learning on thermal elephant imagery. Despite using a standard YOLOv8 framework, the proposed approach achieves high detection performance (precision = 0.964, recall = 0.903, mAP@50 = 0.937), demonstrating that careful thermal data preparation and multi-scale training can yield robust real-time performance without increasing architectural complexity.
Roy et al. (2022b) proposed WilDect-YOLO, a deep learning–based framework that improves feature extraction through residual blocks, DenseNet modules and enhanced SPP-PANet fusion to support real-time detection of endangered wildlife in complex environments. While WilDect-YOLO shows strong performance on challenging RGB wildlife datasets, it focuses on multi-species detection and involves increased architectural complexity. By comparison, the present study adopts a lighter and more application-specific approach, concentrating on single-species elephant detection in thermal imagery. The results indicate that multi-scale YOLOv8 detection, combined with rigorous preprocessing, is sufficient to handle occlusion, motion blur and low thermal contrast, achieving reliable localization without additional network modules.