Regularized Contrastive Pre-Training for Few-Shot Bioacoustic Sound Detection

Ilyass Moummad, Nicolas Farrugia, Romain Serizel

Abstract

Bioacoustic sound event detection allows for better understanding of animal behavior and for better monitoring biodiversity using audio. Deep learning systems can help achieve this goal. However, it is difficult to acquire sufficient annotated data to train these systems from scratch. To address this limitation, the Detection and Classification of Acoustic Scenes and Events (DCASE) community has recasted the problem within the framework of few-shot learning and organize an annual challenge for learning to detect animal sounds from only five annotated examples. In our study, we introduce a regularization to supervised contrastive loss, to learn non redundant features that exhibit effective transferability to few-shot tasks involving the detection of animal sounds not encountered during the training phase. Our method achieves a high F-score of 61.52%±0.48 when no feature adaptation is applied, and an F-score of 68.19%±0.75 when we further adapt the learned features for each new target task. This work aims to lower the entry bar to few-shot bioacoustic sound event detection by proposing a simple and yet effective framework for this task, and by providing open-source code.

Introduction

Monitoring biodiversity through bioacoustic sound event detection (BSED) is a critical tool for conservation biology. However, the scarcity of labeled data for rare or endangered species poses a significant challenge for traditional deep learning models, which typically require thousands of annotated examples. Few-Shot Learning (FSL) addresses this by requiring models to generalize to new classes from as few as five annotated examples (the "shots").

Contrastive Learning (CL) is a popular technique in FSL that teaches models to map similar sounds close together and dissimilar sounds far apart in a feature space. A major pitfall of CL is "dimensional collapse," where the model learns redundant features that occupy a low-dimensional subspace. While effective for training data, these collapsed representations often fail to generalize to novel species.

Methodology

The proposed framework addresses dimensional collapse through a two-stage process: regularized pre-training and task-specific adaptation.

Regularized Pre-training

The core innovation is the application of Total Coding Rate (TCR) regularization to Supervised Contrastive Learning (SCL). Derived from information theory, TCR encourages the model to maximize the "volume" of the learned feature space. By forcing features to be non-redundant and diverse, the model retains latent information that may be critical for identifying unseen species during the inference phase.

Overview of the proposed few-shot bioacoustic detection framework, illustrating the transition from contrastive training to validation using a nearest prototype classifier.

Inference and Fine-tuning

At inference time, the system employs a Nearest Prototype Classifier. It calculates a "prototype"—an average embedding—for both the target sound (presence) and background noise (absence) based on the five provided shots. Classification is performed by calculating the Euclidean distance between sliding window segments of the audio and these prototypes.

For enhanced performance, an optional fine-tuning stage adapts the pre-trained model to the specific target audio. This uses a stabilized Prototypical Network loss designed to handle the extreme class imbalance between rare animal calls and constant background noise.

Experimental Setup

The model was evaluated using the DCASE Few-Shot Bioacoustic Sound Detection datasets. The training set consists of general labeled bioacoustic data, while the validation sets include diverse, unseen species such as Hawaiian Birds (HB), Marine Mammals (ME), and Passerine Birds (PB).

Results and Discussion

The regularized contrastive approach demonstrates significant improvements over baseline methods. As shown in the performance table, the model achieves a 61.52% F-score without fine-tuning. With task-specific adaptation, the performance increases to 68.19%, setting a new benchmark for segment-level few-shot detection.

Performance comparison on validation datasets (HB, ME, PB) showing the effectiveness of the proposed regularized contrastive approach with and without fine-tuning.

Ablation studies confirmed that TCR regularization alone improved the F-score by approximately 2% compared to standard SCL. This supports the hypothesis that feature diversity is a key driver of transferability in few-shot bioacoustic tasks. Furthermore, switching from a standard linear classifier to a metric-based approach provided greater stability against class imbalance.

Conclusion

This research introduces a robust framework for few-shot bioacoustic detection by preventing feature redundancy through TCR regularization. While the optional fine-tuning stage adds computational overhead, it significantly boosts accuracy. Future work will focus on optimizing for "one-shot" scenarios and improving temporal precision for short vocalizations.

Reference: Moummad, I., Farrugia, N., & Serizel, R. (2024). Regularized Contrastive Pre-Training for Few-Shot Bioacoustic Sound Detection. ICASSP 2024. arXiv:2309.08971

Summary updated

BibTeX
@misc{moummad2023regularized,
  author = {Ilyass Moummad and Nicolas Farrugia and Romain Serizel},
  title = {{Regularized Contrastive Pre-Training for Few-Shot Bioacoustic Sound Detection}},
  year = {2023},
  eprint = {2309.08971},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.08971},
}
Figure