Manuscript Offprint

arXiv:2609.17479

Det-LIME: Detector-Aware, Multi-Instance Local Interpretable Model-Agnostic Explanations for Automated Marine Mammal Detection

Jiayi Zhou, David W. Johnston, Brinnae Bent

Abstract

Despite the rapid uptake of black-box object detectors in marine mammal research and monitoring, explainability techniques are rarely integrated into conservation workflows. Furthermore, most classification-oriented explainability tools are ill-suited to detection tasks involving imagery of social organisms or those with colonial life histories, as they ignore multiple detections within a scene and produce single-instance outputs that blur evidence across individuals. These methods also generate low-resolution, often biologically irrelevant visuals, limiting their utility for debugging, targeted data augmentation, and refined data collection.

We proposed Det-LIME, a detector-aware, multi-instance adaptation of Local Interpretable Model-Agnostic Explanations (LIME) that produced instance-specific, box-aligned explanations by combining per-detection weighting, a proximity kernel that emphasizes regions near each box, and Intersection-over-Union-based matching to track the same instance across perturbations. We evaluated Det-LIME on aerial drone imagery for harbor seal detection, with an additional seabird case study to assess generality, and compared it with vanilla LIME, Stabilized LIME, Deterministic LIME, and gradient-based attribution methods.

Using the Attribution Ratio and Max Saliency Hit Rate metrics, we showed that Det-LIME consistently improved multi-instance attribution. In practice, these higher-resolution, instance-aware explanations provide insight into model outputs and support post-processing, debugging, and actionable improvements in modeling and data collection or augmentation.

Keywords: Object detection; computer vision; explainable artificial intelligence; marine mammals; ecological monitoring

1 Introduction

Computer vision and artificial intelligence methods now underpin many ecological workflows: from tracking wildlife populations and assessing habitat change to informing management actions and protected-species policy (Gray et al., 2022; Růžička et al., 2023). Classification and object detection methods are commonly used within computer vision workflows to automatically identify, count, and locate species and landscape features in large image and video datasets, enabling scalable biodiversity monitoring and informed conservation decisions (Tabak et al., 2018; Choiński et al., 2021).

*Corresponding author: brinnae.bent@duke.edu

As detectors mature, accuracy is no longer the only limiting factor. Practitioners need evidence that predictions are grounded in animal morphology (not background shortcuts), clear views of failure modes, and defensible rationale when setting thresholds that carry operational and ethical costs (Gevaert, 2022; Buchelt et al., 2024). This is particularly true for what people refer to as "black-box" models like neural networks with opaque internal "reasoning". Although researchers who develop and train their own models may have access to the model architecture, this level of access is not always available in applied ecological workflows. Models may be developed by external collaborators, incorporated into third-party software, accessed through hosted services, or deployed in monitoring systems that provide predictions without exposing internal feature maps or gradients. Even when the model architecture is available, explanation methods that rely on internal representations generally require architecture-specific choices, including identifying appropriate feature layers and linking the prediction of interest to the corresponding activations and gradients. These requirements can vary across detector architectures and make the same explanation procedure more difficult to apply consistently across models. Despite these needs, explainability is rarely integrated into ecological research or conservation workflows.

Explainability helps provide insights into model predictions by revealing which input features and internal representations drive a model's decision-making process. One such explainable AI (XAI) technique is Local Interpretable Model-Agnostic Explanations (LIME) (Ribeiro et al., 2016). LIME generates perturbed versions of the input image and observes how the black-box model's predictions change. It then fits a simple linear model to these perturbations to approximate the local decision boundary, using the linear coefficients to estimate the contribution of each image region. This provides a locally interpretable explanation of the model's prediction. In the context of marine mammal ecology, LIME is particularly well-suited because it is model agnostic, local, and produces spatially grounded, human-understandable overlays. Because it operates from model inputs and outputs, it does not require users to select internal feature layers or adapt the explanation procedure to specific internal representations. This provides a consistent way to examine predictions across detector architectures, including settings where internal model information is unavailable or difficult to use directly for explanation. These properties align with how ecologists audit individual predictions and allow visual verification that predictions are based on animal morphology rather than background features. LIME's portability, locality, and communicability make it well-matched to ecological decision-making.

Classification models produce a single, image-level prediction, and explanation methods in this setting attribute evidence to that overall decision. In contrast, multi-object detection systems often produce multiple localized predictions within a single image, where each prediction is defined by a bounding box, a class label, and a confidence score. This distinction is important in ecological images, where multiple animals often appear together, crowded within a single frame. Conventional LIME approaches are designed for per-image classification, not instance-level detection in complex and often unpredictable ecological scenes. In practice, conventional LIME techniques explain a label's image-level score rather than a detector's per-box prediction; their perturbations are often coarse, engulfing multiple small animals and blurring evidence across neighboring boxes; they have no mechanism to remain focused on predicted objects as perturbations alter proposals; and they weight these perturbations globally, rather than centering on the queried box. The result is blocky heatmaps that attribute background textures more than morphology in predictions, offering limited guidance for threshold setting, post-processing, or targeted data collection. Explanation methods for multi-object detection in ecological imagery must provide instance-level, spatially precise attributions that are stable for a given detection while accounting for nearby objects and complex background patterns.

To address these limitations, we introduce Det-LIME, a detector-aware, multi-instance adaptation of LIME designed for object detection in ecological imagery. Det-LIME produces instance-specific, box-aligned explanations by fitting a model that approximates the detector's behavior near a target detection. The framework (i) handles multiple detections through instance weighting, (ii) emphasizes regions near each box with a proximity kernel, and (iii) tracks the same instance under perturbations using intersection over union (IoU)-based matching. The goal was actionable clarity: higher-resolution, per-animal evidence that aligns with how ecologists review detections and ultimately make policy-relevant decisions.

References (36)