Abstract
Wildlife preserves are critical for countering the decline of biodiversity, yet monitoring species distribution and demographics via direct observation is time-consuming and prone to observer disturbance. Deep learning has emerged as a scalable alternative for analyzing field data, yet the ’black-box’ nature of standard models hinders their adoption. This is a major obstacle in ecological research, where transparent reasoning is essential for trust and meaningful interpretation. We address this challenge through the lens of sex classification in the endangered Mountain Gazelle, utilizing a dataset of 1833 cropped bounding boxes extracted from unconstrained camera trap imagery. Reliable automated classification from field imagery is essential for assessing population structure and welfare metrics for effective conservation management. While Mountain Gazelles exhibit distinct sexual dimorphism in horn morphology and body size, inferring sex from unconstrained camera trap data remains challenging due to significant variability in pose, illumination, and occlusion. To enhance explainability in Mountain Gazelle sex classification, we employed a prototype-based deep learning framework. Unlike standard “black-box” models, this approach represents classes through learned visual exemplars (prototypes) that correspond directly to crucial image features, ensuring transparent reasoning. Building upon the PIP-Net architecture, we introduced a novel enhancement: the ability to learn prototypes of variable sizes and aspect ratios, moving beyond rigid, fixed-size patches. These prototypes are learned autonomously without manual trait annotation, allowing the model to discover distinct regional features. By optimizing across a list of candidate scales, our non-fixed prototype approach captures larger, more semantically coherent regions, achieving a global accuracy and F1-score of 75% alongside detailed explanations. Our analysis indicates that prominent prototypes frequently capture regions consistent with known morphological traits: both sexes are often identified via central body, leg, and head features, with the model distinguishing between them based on sex-specific morphological proportions. For males, horn-related prototypes serve as a distinct cue, reflecting the main dimorphic trait cited in literature. These representations suggest that the model’s decision-making relies on relevant morphological features rather than background artifacts, offering a transparent and accurate tool for wildlife classification. The dataset will be made publicly available upon publication.
Funding
The last author was supported by supported by the SNSF-ISF binational project Switzerland – Israel (grant number 1050/24)..
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/
About this article
Cite this article
Shitrit, T., Kedem, A., Yagur, E. et al. Prototype-based explainable deep learning for sex classification of Mountain Gazelles in the wild. Sci Rep (2026). https://doi.org/10.1038/s41598-026-71679-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-026-71679-9