Acoustic identification of individual animals with hierarchical contrastive learning

Inês Nolasco, Ilyass Moummad, Dan Stowell, Emmanouil Benetos

Abstract

Acoustic identification of individual animals (AIID) is closely related to audio-based species classification but requires a finer level of detail to distinguish between individual animals within the same species. In this work, we frame AIID as a hierarchical multi-label classification task and propose the use of hierarchy-aware loss functions to learn robust representations of individual identities that maintain the hierarchical relationships among species and taxa. Our results demonstrate that hierarchical embeddings not only enhance identification accuracy at the individual level but also at higher taxonomic levels, effectively preserving the hierarchical structure in the learned representations. By comparing our approach with non-hierarchical models, we highlight the advantage of enforcing this structure in the embedding space. Additionally, we extend the evaluation to the classification of novel individual classes, demonstrating the potential of our method in open-set classification scenarios.

Introduction

Bioacoustics has traditionally focused on species-level classification. However, identifying specific individuals—Acoustic Identification of Individual Animals (AIID)—is critical for ecological monitoring and behavioral studies. AIID is significantly more challenging than species classification because intra-species vocal variations are often subtle.

Current AIID systems typically treat individuals as independent, "flat" categories, ignoring the inherent biological hierarchy (Taxon → Species → Individual). Furthermore, these systems often operate in "closed-set" environments, failing to generalize to new individuals encountered in the wild. This research addresses these limitations by leveraging hierarchical contrastive learning to guide the model toward more biologically meaningful representations.

Methodology

The proposed framework utilizes Hierarchical Multi-label Contrastive Learning. The architecture consists of a frozen OpenL3 backbone for audio feature extraction, followed by a shared Multi-Layer Perceptron (MLP) to adapt features for bioacoustic tasks.

Proposed hierarchical contrastive learning architecture for individual animal identification.

To enforce hierarchical relationships, the model employs multiple "projectors" that calculate contrastive losses at three levels: Taxon, Species, and Individual. The researchers explored several loss variants:

  • SupCon (Supervised Contrastive): A baseline that clusters same-class examples while pushing different classes apart.
  • HiMulCon: A hierarchical version applying contrastive logic across all taxonomic levels simultaneously.
  • HiMulConE: An "enforced" version that ensures deeper level losses (e.g., Individual) do not fall below higher level losses (e.g., Species), preserving hierarchical integrity.

Experimental Setup

The study utilized a dataset of 14,295 recordings covering seven species across two taxa:

  • Birds: Chiffchaffs, Tree pipits, Little Owls, and Eurasia eagle owls.
  • Mammals: Spotted hyenas, Rock hyraxes, and Grey wolves.

The evaluation included a standard test set of known individuals and an "unseen ID set" of 21 novel individuals to assess open-set performance.

Results

The hierarchical models consistently outperformed non-hierarchical baselines. As shown in the results table, the hierarchical approach (HC) achieved a balanced accuracy of 73.2% for individual identification, a significant improvement over the 61.0% achieved by the standard contrastive (SC) baseline.

Balanced accuracy results across different models and taxonomic levels.

Crucially, the hierarchical models eliminated "hierarchical inconsistency"—errors where a predicted individual ID does not belong to the predicted species. In open-set scenarios, the hierarchical model (HCλ) improved "one-shot" classification accuracy to 15.3%, compared to the baseline's 6.0%, demonstrating better generalization to novel voices.

Conclusion

This work demonstrates that biological taxonomy serves as an effective structural prior for acoustic embedding spaces. By enforcing hierarchical relationships, models learn more robust features that improve both closed-set identification and open-set generalization. Future research will explore unfreezing the feature extractor for end-to-end adaptation and scaling the approach to larger, more diverse ecosystems.

Summary updated

Abstract

Acoustic identification of individual animals (AIID) is closely related to audio-based species classification but requires a finer level of detail to distinguish between individual animals within the same species. In this work, we frame AIID as a hierarchical multi-label classification task and propose the use of hierarchy-aware loss functions to learn robust representations of individual identities that maintain the hierarchical relationships among species and taxa. Our results demonstrate that hierarchical embeddings not only enhance identification accuracy at the individual level but also at higher taxonomic levels, effectively preserving the hierarchical structure in the learned representations. By comparing our approach with non-hierarchical models, we highlight the advantage of enforcing this structure in the embedding space. Additionally, we extend the evaluation to the classification of novel individual classes, demonstrating the potential of our method in open-set classification scenarios.
BibTeX
@inproceedings{nolasco2025acoustic,
  author = {Inês Nolasco and Ilyass Moummad and Dan Stowell and Emmanouil Benetos},
  title = {{Acoustic identification of individual animals with hierarchical contrastive learning}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=2LNakXRKxm},
}
Figure